Ubiquiti UniFi OpenVPN Server Setup
3 min read
8 months ago
Published on Jul 07, 2025
This response is partially generated with the help of AI. It may contain inaccuracies.
Table of Contents
Introduction
In this tutorial, we will guide you through setting up an OpenVPN server on a Ubiquiti UniFi device. This process is straightforward, allowing you to create a secure VPN connection for remote access. Please note that this setup may not work with Carrier-Grade NAT (CGNAT) connections, so if you're using services like Starlink, alternative solutions may be necessary.
Step 1: Access Your UniFi Controller
- Open your web browser and navigate to your UniFi Controller interface.
- Log in using your administrator credentials.
- Ensure your device is running UniFi OS 3.0.20 and UniFi 7.4 EA for compatibility.
Step 2: Configure the Network Settings
- Go to the Settings section in the UniFi Controller.
- Select Networks from the menu.
- Click on Create New Network.
- Set the following parameters:
- Name: Give your network a descriptive name (e.g., "OpenVPN").
- Purpose: Select Remote User VPN.
- VPN Type: Choose OpenVPN.
- Configure the VPN settings:
- Client IP Range: Specify a range of IP addresses for VPN clients.
- DNS Server: Use a public DNS server (like Google DNS: 8.8.8.8).
Step 3: Enable and Configure OpenVPN Server
- In the same network settings, enable the OpenVPN server option.
- Set the Server Protocol to UDP for better performance.
- Define the Port for the OpenVPN server (default is 1194).
- Optionally, adjust other settings such as compression and encryption level according to your security needs.
Step 4: Set Up User Authentication
- Navigate to the Users section in your UniFi Controller.
- Click on Add User to create accounts for each VPN user.
- Enter the following details:
- Username
- Password
- Assign the user to the OpenVPN network you created earlier.
Step 5: Generate and Download VPN Configuration Files
- Go back to the Networks section and select your OpenVPN network.
- Look for the option to Download Configuration.
- This file will be used to set up the OpenVPN client on user devices.
Step 6: Set Up OpenVPN Client
- On the client device, install the OpenVPN client application.
- Import the configuration file you downloaded.
- Enter the username and password for authentication.
- Connect to the VPN and verify the connection.
Conclusion
You have successfully set up an OpenVPN server on your Ubiquiti UniFi device. This setup allows secure remote access to your network. If you encounter any issues related to CGNAT, consider exploring alternative VPN solutions. For further assistance or to expand your networking knowledge, consider joining training sessions or consulting services. Happy networking!