The simplest and fastest way to install OpenVPN is to use the Portainer template prepared by our team. This method minimizes manual configuration and allows you to deploy a stable, ready-to-use setup in just a few minutes.
Requirements
A VPS with Portainer installed using the Unihost script
A deployed NPM (Nginx Proxy Manager)
After installing Portainer, log in using your credentials.
After installing Portainer, log in using your credentials.




You need to fill in all the fields for OpenVPN to work correctly, and also specify the following value in the Web UI URL prefix section:
/openvpn

After that, you will see OpenVPN in the Stacks section.

Now go to NPM to configure proxying.
In the Details section, fill in the fields as shown in the screenshot.

You also need to fill in the Custom locations section.

To connect to OpenVPN and continue the setup, go to the domain you specified earlier. Before that, add it to the hosts file.
In the browser’s address bar, enter:
domain/openvpn
After that, the login page will open. Enter your credentials, and you will be redirected to the admin panel with user settings.

Now you need to install OpenVPN. To do this, click the red notification at the top:
“OpenVPN needs to be setup”
After that, the installation will begin. Follow the wizard steps and complete the OpenVPN setup.

Next, proceed to creating a new client. To do this, click Add New Client and fill in the required fields.
Be sure to specify a value in the User Password field — this password will be used when connecting to the VPN.


After the new client has been created, you need to generate a certificate for it.
Go to the Certificates section and add a new certificate for your user.

Now click Apply Configuration, and your user will be fully set up.


To download the configuration file for connecting on your PC, go to the Certificates section and download the required file.
Linux/Ubuntu 24.04

Open the top panel and select VPN Settings.

Click + and select Import from file.

After adding the profile, you will see the new VPN connection created in the VPN section.

Now you need to go to the settings by clicking the gear icon, and in the Identity section select the User name field, then enter the same username as in OpenVPN.

Now you can use the VPN on your PC.
Windows
Download and install the OpenVPN client from the official website:
https://openvpn.net/client/
Upload the previously created configuration file and import it into the client.
When connecting, enter the UserName and password that you specified when creating the client.
Conclusion
Using the ready-made Portainer template significantly saves time and reduces the chance of errors. As a result, you get a fully functional VPN out of the box with minimal setup effort.