openvpn

How To Install OpenVPN Access Server on Ubuntu 24.04 or Newer

Welcome back to the Greenhost.cloud blog! In today’s post, we will guide you through the process of installing OpenVPN Access Server on Ubuntu 24.04 or newer. OpenVPN Access Server is a powerful, flexible, and secure VPN solution that allows you to create your own private network, ensuring secure access to your resources from anywhere in the world.

What You’ll Need

Before we start with the installation, ensure you have the following prerequisites:

  1. A server running Ubuntu 24.04 or newer.
  2. Root or sudo access to the server.
  3. An internet connection to download necessary packages.
  4. Basic knowledge of using the command line.

Let’s dive in!

Step 1: Update Your Server

First, it’s always a good practice to ensure that your server is up-to-date. Open your terminal and run the following commands:

sudo apt update
sudo apt upgrade -y

This will update your package lists and upgrade any outdated packages.

Step 2: Install OpenVPN Access Server

OpenVPN provides an easy way to install the Access Server using their official package. To begin, you’ll need to download and install the OpenVPN Access Server package. Use the following commands:

wget https://openvpn.net/downloads/openvpn-as-latest-ubuntu22.amd64.deb

Note: The package name may change with newer releases. Always check the OpenVPN downloads page for the latest version.

Next, install the package with:

sudo dpkg -i openvpn-as-latest-ubuntu22.amd64.deb

If you encounter any dependency issues, run:

sudo apt install -f

This will fix any missing dependencies.

Step 3: Configure OpenVPN Access Server

After the installation is complete, you need to set up the OpenVPN Access Server. The installation process automatically generates a default username and password.

  1. Set the Admin Password: Run the following command to set the password for the default admin account (openvpn):
   sudo passwd openvpn

You will be prompted to enter a new password.

  1. Access the Admin Web Interface: Open your web browser and navigate to https://<your_server_ip>:943/admin. Replace <your_server_ip> with the actual IP address of your server. Log in using the username openvpn and the password you just set.

Step 4: Configure VPN Settings

Once logged in, you can customize your VPN settings. Here are a few key configurations you might want to adjust:

  1. Network Settings: Under the “Network” tab, you can configure the VPN subnet and routing options.
  2. User Management: Create users and assign them permissions as needed.
  3. Authentication: You can enable various authentication methods, including username/password, certificate-based, and two-factor authentication.

Step 5: Client Configuration

After configuring the server, you can set up your clients. For Windows, macOS, Linux, and mobile devices, OpenVPN provides easy-to-follow client configuration guides available in the admin interface.

  1. Direct users to https://<your_server_ip>:943 for the client interface.
  2. Users can log in and download the appropriate client configuration files.

Step 6: Start and Enable OpenVPN Service

Make sure the OpenVPN Access Server is running and set to start on boot:

sudo systemctl start openvpnas
sudo systemctl enable openvpnas

Step 7: Firewall Configuration

If you have a firewall enabled on your server, make sure to allow traffic on the necessary ports:

sudo ufw allow 943/tcp
sudo ufw allow 1194/udp
sudo ufw allow OpenSSH

Finally, enable the UFW firewall if it’s not already running:

sudo ufw enable

Conclusion

Congratulations! You have successfully installed OpenVPN Access Server on Ubuntu 24.04 or newer. You can now enjoy the benefits of a secure, private network. Whether you’re using it for remote work, secure browsing, or accessing restricted resources, OpenVPN provides a reliable solution.

If you have any questions or run into issues, feel free to leave a comment below or reach out to our support team at Greenhost.cloud. Happy VPNing!


For more tips and tutorials on managing your cloud infrastructure and improving your online security, don’t forget to subscribe to our blog!