This OpenVPN Sever setup automation closely follows best practices such as those found in official Ubuntu OpenVPN documentation.
-
Run the Docker container:
docker run --name openvpn-server-easy --restart=unless-stopped -d -p 1194:1194/udp --device=/dev/net/tun --cap-add=NET_ADMIN warfront1osed/openvpn-server-easy:latest && docker logs -f openvpn-server-easy -
Wait for OpenVPN to start:
You will seeInitialization Sequence Completedin the logs when OpenVPN is ready to use. -
Obtain client credentials:
Tip: To run the next command, you can either open a new terminal or press
Ctrl+Cto exit the log stream.docker cp openvpn-server-easy:/client_credentials/. ./
This command copies the client configuration files from the container to your current directory.
-
Connect to the VPN:
The easiest way to connect is by importing theclient.ovpnfile into an OpenVPN client.We recommend OpenVPN Connect, the official client, which is available on:
- 🪟 Windows
- 🍏 macOS
- 🐧 Linux
- 📱 iOS
- 🤖 Android
- 🌐 ChromeOS
If your client does not support
.ovpnprofiles, or you prefer to configure it manually, use the following files:ca.crtclient.crtclient.keyta.key
Environment Variables
Most users can ignore this section. These variables are optional and only needed for non-default setups.
| Variable | Default | Description |
|---|---|---|
REDIRECT_GATEWAY_LOCAL |
false |
Set to true to also push the local flag for redirect-gateway. Needed when a client and the server are on the same LAN/subnet (e.g., same Wi-Fi) — it skips creating a static route to the server via the original default gateway. Default false suits remote clients on a different subnet. |