Setting up a self-hosted OpenVPN Access Server allows you to create a secure, encrypted tunnel between your remote devices and your home or office network, enabling safe access to local files, smart home controllers, and internal services as if you were physically connected to the local router. To achieve this, you need a server running a supported Linux distribution, a static IP address or a dynamic DNS service, and administrative access to your network router to forward the necessary traffic ports.
What You'll Need
- A server or virtual machine running a supported Linux OS (such as Ubuntu or Debian).
- A public IP address (static is preferred, but dynamic DNS works).
- Root or sudo privileges on the Linux machine.
- Access to your router's administrative panel for port forwarding.
- An OpenVPN Access Server account (the free tier supports two concurrent connections).
Step-by-Step
- Prepare the Server Environment: Start by ensuring your Linux server is fully updated to prevent dependency conflicts. Open your terminal and run the update commands for your specific distribution. For Ubuntu or Debian, use
sudo apt update && sudo apt upgrade -y. This ensures that the kernel and system libraries are current before the installation of the VPN software begins. - Install the OpenVPN Access Server: The most reliable method is using the official installation script provided by OpenVPN. Download and execute the script using
curlorwget. Once the script starts, it will detect your operating system and install the necessary packages. During the installation process, the system will prompt you to set an administrative password. This password is critical as it grants access to the web-based Admin UI; ensure it is a strong, unique string. - Configure Initial Network Settings: After the installation completes, the terminal will display the URLs for the Admin UI and the Client UI. Note these down. If you are installing this on a cloud VPS, the IP address provided will be your public IP. If you are installing it on a local machine, it will be a local IP (e.g., 192.168.x.x). You will need to access the Admin UI via a web browser by navigating to . Note that your browser may show a security warning because the server uses a self-signed certificate by default; you can safely bypass this by clicking "Advanced" and "Proceed."
- Set Up Port Forwarding on Your Router: For remote devices to reach your server from the internet, your router must know where to send VPN traffic. Log into your router's administrative interface. Navigate to the port forwarding or virtual server section. Create two rules: one for UDP port 1194 (the default for VPN traffic) and one for TCP port 443 or 943 (for the web interface and HTTPS traffic). Direct both of these ports to the internal IP address of your Linux server.
- Configure the Admin UI Settings: Once logged into the Admin UI, go to the Network Settings section. Here, you must ensure the "Hostname or IP Address" field contains your public IP address or your Dynamic DNS hostname. If this is left as a local IP, your remote clients will be unable to connect because they will try to find the server inside their own local network rather than over the internet. Save the settings and apply them.
- Create User Accounts: Navigate to the User Management section in the Admin UI. Create a new user by providing a username and password. You can assign specific permissions to this user, such as allowing them to access only certain parts of the network or granting them full access to all local resources. Each user will have their own credentials to log into the Client UI.
- Download and Install the Client: On the device you wish to connect (Windows, macOS, Android, or iOS), download the official OpenVPN Connect app from the official app store or website. Open the app and enter the Client UI URL (usually ). Log in with the user credentials you created in the previous step. The app will then automatically download the necessary configuration profile (.ovpn file) and establish the encrypted connection.
Common Mistakes
One of the most frequent errors is forgetting to update the Hostname in the Admin UI. Many users leave the default local IP address, which works perfectly while testing on the same network but fails immediately when attempting to connect via mobile data or a different Wi-Fi network. Always ensure the server is broadcasting its public-facing identity.
Another common mistake is neglecting the firewall on the Linux server itself. Even if the router is forwarding ports, the internal OS firewall (like UFW or firewalld) might be blocking the traffic. You must explicitly allow traffic on ports 1194 (UDP), 443 (TCP), and 943 (TCP) within the server's own security settings.
Users often confuse the Admin UI with the Client UI. The Admin UI (port 943/admin) is for server configuration and user management, while the Client UI (port 943) is where end-users log in to download their profiles. Attempting to use the Client UI for administrative changes will not work.
Tips
To maintain a consistent connection without a static IP, implement a Dynamic DNS (DDNS) service. This assigns a domain name (e.g., myhomevpn.ddns.net) to your home IP. If your ISP changes your IP address, the DDNS client updates the record, and your VPN clients will continue to connect using the domain name rather than a numerical IP that may have expired.
For better security, consider changing the default UDP port 1194 to a non-standard port. While this is not a substitute for strong encryption, it reduces the amount of "noise" and automated bot scans hitting your server, which can slightly improve stability and security logs.
Regularly back up your configuration files and the OpenVPN database. If your server hardware fails, having a backup of the user database and the cryptographic keys will allow you to restore service quickly without having to re-issue profiles to every single connected device.
Troubleshooting
If the VPN client fails to connect, the first step is to verify the server status. Check if the OpenVPN service is running on the Linux machine by using the command systemctl status openvpn-as. If the service is inactive, restart it using sudo systemctl restart openvpn-as.
If the service is running but the client still cannot connect, verify the port forwarding. Use an external port-checking tool to see if UDP port 1194 is "Open" from the outside world. If it shows as "Closed" or "Filtered," the issue lies with your router settings or your ISP (some ISPs block common VPN ports or use CGNAT, which prevents traditional port forwarding).
If you can connect but cannot access local network devices (like a NAS or a smart home hub), check the routing settings in the Admin UI. Ensure that the "Should clients have access to private subnets?" option is enabled and that the correct local subnet (e.g., 192.168.1.0/24) is listed in the configuration. If the subnet is incorrect, the VPN will connect, but your traffic will have nowhere to go once it reaches the server.
In cases where the connection is extremely slow or drops frequently, try switching the protocol from UDP to TCP in the Admin UI. While UDP is generally faster for VPNs, some restrictive networks (like corporate offices or public hotspots) block UDP traffic entirely, making TCP the only viable option for a stable connection.
Frequently Asked Questions
Can I use this for more than two users?
The free version of OpenVPN Access Server supports up to two concurrent connections. For more users, you would need to purchase a license or switch to the community edition of OpenVPN, which is entirely free but requires manual configuration via command line instead of a web UI.
Is a Raspberry Pi powerful enough to host this?
Yes, a Raspberry Pi 3 or 4 is more than capable of handling a few concurrent VPN connections. However, ensure you use a high-quality SD card or an external SSD to prevent data corruption during frequent log writes.
Do I need to open port 80 or 443?
You need port 443 or 943 for the web-based management and profile downloads. Port 80 is generally not required unless you are using a reverse proxy to handle SSL certificates via Let's Encrypt.
What is the difference between the Community Edition and Access Server?
The Access Server is a commercial product with a user-friendly web interface and simplified setup. The Community Edition is open-source, lacks a GUI, and requires you to manually edit configuration files and manage certificates via the command line.
Will this slow down my internet speed?
Yes, all VPNs introduce some overhead due to encryption and the routing path. Your maximum speed will be limited by the upload speed of the server's internet connection and the processing power of the server hardware.
Can I access my router's admin page through the VPN?
Yes, as long as the VPN is configured to allow access to the local subnet, you can enter your router's local IP address in your browser while connected to the VPN to manage your network remotely.