Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
O

openvpn-ui

> 编程语言
Open source

Web User Interface for OpenVPN

734 stars0 likes3 views
WebsiteGitHub

About

Web User Interface for OpenVPN

OpenVPN UI

OpenVPN server web administration interface.

Quick to deploy and easy to use, makes work with small OpenVPN environments a breeze.

Features

  • Status page that shows server statistics and list of connected clients
  • Supports OpenVPN tunnel(dev tun) or bridge(dev tap) server configurations
  • Easy to generate, download, renew, revoke, delete and view client certificates
  • Client can have secret passphrase and static IP assigned during client certificate generation
  • Two factor authentication (2FA/MFA) support
  • Change predefined EasyRSA vars including certificates and CRL expiration time
  • Maintain EasyRSA PKI infrastructure (init, build-ca, gen-dh, build-crl, gen-ta, revoke)
  • Change OpenVPN Server configuration via web interface
  • Easy to preview OpenVPN Server logs
  • Restart OpenVPN Server and OpenVPN UI from web interface
  • OpenVPN-UI users management. Administrators has full access, regular users to Certificates management, logs and status page only.
  • OpenVPN-UI Admin user and password can be passed via environment variables to container
  • Updated infrustracture:
    • Alpine Linux as fastest and secure base image
    • GoLang 1.21
    • Beego 2.1 with all vulnerabilities fixed
    • Easy-rsa 3.X
    • Openssl 3.X
    • OpenVPN 2.5.8 Server is fully compatible
      • Compatible OpenVPN Server images can be found on Docker Hub - d3vilh/openvpn-server:latest
      • As well as Openvpn-UI itself - d3vilh/openvpn-ui:latest
  • Support any architecture, ready images for AMD64 and ARM available on Docker Hub.

Part of following projects:

  • Openvpn-aws OpenVPN and OpenVPN-UI for any Cloud, VM or x86 bare metal server.
  • Raspberry-gateway simple yet powerful home gateway environment with Pi-Hole +Unbound, VPN, Torrent client and Internet monitoring, all managed by Portainer.

Installation

For the best experience, it is recommended to deploy it within a Docker environment consisting of two distinct containers:

  • The d3vilh/openvpn-server Back-End container (openvpn) for running OpenVPN server.
  • OpenVPN UI Front-End container (openvpn-ui) for efficient management of the OpenVPN server environment.

However it works fine as standalone application with standalone OpenVPN server as well.

Intel x86 and AMD64 platforms

You can run both containers from the official openvpn-server repository, docker-compose-openvpnui.yml. It includes all the files in its main directory.

For automated installation on baremetal x86-64 servers, Cloud or VM installation, please use openvpn-aws project. It, as well, includes all the necessary scripts for easy installation of OpenVPN-UI and OpenVPN server on any x86-64 platform.

Raspberry-pi and other ARM platforms

For Raspberry-Pi and other ARM devices, consider Raspberry-Gateway project. It has all the necessary scripts for easy installation and lot of additional features.

You can run both containers from the openvpn-server repository as well (use docker-compose-openvpnui.yml). It includes all the files in its main directory, as well.

Manual installation

With Docker-compose

Running this image with docker-compose.yml file

yaml
    openvpn-ui:
       container_name: openvpn-ui
       image: d3vilh/openvpn-ui:latest
       environment:
           - OPENVPN_ADMIN_USERNAME={{ ovpnui_user }}
           - OPENVPN_ADMIN_PASSWORD={{ ovpnui_password }}
       privileged: true
       ports:
           - "8080:8080/tcp"
       volumes:
           - ./:/etc/openvpn
           - ./db:/opt/openvpn-ui/db
           - ./pki:/usr/share/easy-rsa/pki
           - /var/run/docker.sock:/var/run/docker.sock:ro
       restart: always

You can also couple OpenVPN-UI with recommended d3vilh/openvpn-server image and here is updated docker-compose.yml for it:

…

If you start this compose file with volumes listed above (click to see detail)

You have to run these commands before starting:

bash
mkdir -p /var/data/d3openvpn # change it as you needed
cd /var/data/d3openvpn

git clone https://github.com/d3vilh/openvpn-server . # or download the zip file from GitHub if you don't have git installed

sudo docker compose -f docker-compose.yml up -d

or

bash
mkdir -p /var/data/d3openvpn # change it as you needed
cd /var/data/d3openvpn

mkdir -p ./config
wget https://raw.githubusercontent.com/d3vilh/openvpn-server/refs/heads/main/server.conf -O server.conf
wget https://raw.githubusercontent.com/d3vilh/openvpn-server/refs/heads/main/config/easy-rsa.vars -O config/easy-rsa.vars
wget https://raw.githubusercontent.com/d3vilh/openvpn-server/refs/heads/main/config/client.conf -O config/client.conf
echo "" > ./fw-rules.sh

sudo docker compose -f docker-compose.yml up -d

Where:

  • TRUST_SUB is Trusted subnet, from which OpenVPN server will assign IPs to trusted clients (default subnet for all clients)
  • GUEST_SUB is Gusets subnet for clients with internet access only
  • HOME_SUB is subnet where the VPN server is located, thru which you get internet access to the clients with MASQUERADE
  • fw-rules.sh is bash file with additional firewall rules you would like to apply during container start

docker_entrypoint.sh will apply following Firewall rules:

bash
IPT MASQ Chains:
MASQUERADE  all  --  ip-10-0-70-0.ec2.internal/24  anywhere
MASQUERADE  all  --  ip-10-0-71-0.ec2.internal/24  anywhere
IPT FWD Chains:
       0        0 DROP       1    --  *      *       10.0.71.0/24         0.0.0.0/0            icmptype 8
       0        0 DROP       1    --  *      *       10.0.71.0/24         0.0.0.0/0            icmptype 0
       0        0 DROP       0    --  *      *       10.0.71.0/24         192.168.88.0/24

Here is possible content of fw-rules.sh file to apply additional rules:

bash
~/openvpn-server $ cat fw-rules.sh
iptables -A FORWARD -s 10.0.70.88 -d 10.0.70.77 -j DROP
iptables -A FORWARD -d 10.0.70.77 -s 10.0.70.88 -j DROP
With Dockerfile

Run this image using the Dockerfile

Run the OpenVPN-UI image

bash
docker run \
-v /home/pi/openvpn:/etc/openvpn \
-v /home/pi/openvpn/db:/opt/openvpn-ui/db \
-v /home/pi/openvpn/pki:/usr/share/easy-rsa/pki \
-v /home/pi/openvpn/log:/var/log/openvpn \
-v /var/run/docker.sock:/var/run/docker.sock \
-e OPENVPN_ADMIN_USERNAME='admin' \
-e OPENVPN_ADMIN_PASSWORD='gagaZush' \
-p 8080:8080/tcp \
--privileged d3vilh/openvpn-ui:latest

Run the OpenVPN Server image:

…
Building own image

Building own image

Prerequisites

As prerequisite, you need to have Docker and GoLang to be installed and running:

bash
sudo apt-get install docker.io -y
sudo systemctl restart docker

To install Golang go to https://go.dev/dl and copy download URL for Go1.20.X version of your arch and follow the instructions below.

Example for ARM64:

bash
wget https://golang.org/dl/go1.20.linux-arm64.tar.gz
sudo tar -C /usr/local -xzf go1.20.linux-arm64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> /etc/profile
source /etc/profile
go version 
Building the image

To build the OpenVPN-UI image:

bash
cd build; ./build_openvpn-ui.sh

The new image will have openvpn-ui name.

Standalone installation

Standalone installation without docker and docker-compose

If you have your OpenVPN server up and running on the same host, you can install OpenVPN-UI as standalone application. For this you need to have GoLang installed on your host to build all the necessary binaries on the server itself.

To make installation easier, version 0.9.5 now includes a standalone-install.sh script. This script helps you step by step, starting with downloading and installing GoLang, and ending with building the binaries.

At the moment script supports Debian based systems only.

Here is installation process example:

…

After build and installation is complete:

  1. Put archive openvpn-ui.tar.gz with binaries to the desired directory where you would like to run OpenVPN-UI from.
  2. Uncompress it with tar -xzf openvpn-ui.tar.gz.
  3. Double check openvpn-ui binary has +x permissions for your user.
  4. Create db directory in the same directory where openvpn-ui binary is located.
  5. Update OpenVpnPath and EasyRsaPath with real location of your OpenVPN server config (/etc/openvpn) and EasyRSA (/usr/share/easy-rsa) in main application config file - ./conf/app.conf file.
  6. Set EnableAdmin = false and RunMode = prod in the same file, if you don't need to run BeeGo in development mode and don't need BeeGo admin console to run (in most cases you don't need it).
  7. On the first run set OPENVPN_ADMIN_USERNAME and OPENVPN_ADMIN_PASSWORD environment variables to create admin user with secret password:
bash
export OPENVPN_ADMIN_USERNAME=admin
export OPENVPN_ADMIN_PASSWORD=$3kR3tPa$Sw0rd
  1. doublecheck enviroment variables are set properly:
bash
echo $OPENVPN_ADMIN_USERNAME
echo $OPENVPN_ADMIN_PASSWORD

This should return your username and password you will use for the first login into UI. It is mandatory to set this vars on the first application start only. So OpenVPN-UI will create your Admin user with your own credentials.

  1. Run ./openvpn-ui binary and login with your new credentials.

  2. Go to Configuration > OpenVPN Server and update all the fields with your current server.conf options.

  3. For security reasons you have to unset vars after successful login, so it will be removed from the local server environment:

bash
unset OPENVPN_ADMIN_USERNAME
unset OPENVPN_ADMIN_PASSWORD

Upgrade to new Version

During the installtion or upgrade process OpenVPN-UI by itself does not do any changes to your OpenVPN server configuration or PKI infrastructure. However it is recommended to perform backup of your PKI infrastructure, server.conf, client.conf and data.db before following with upgrade steps.

Backup

Backup

To backup your PKI infrastructure, server, client configuration files and OpenVPN-UI DB you can use backup.sh script which is in build/assets directory (since the release 0.6), it is also part of openvpn-aws and Raspberry-Gateway projects (right in openvpn-server directory).

Copy the script in your home directory(any directory in fact):

bash
cp -p build/assets/backup.sh ~/

Then run the script:

bash
sudo ./backup.sh -b ~/openvpn-server backup/openvpn-server-030923-1

this will create backup of all necessary files, from ~/openvpn-server to ~/backup/openvpn-server-030923-1.

You can confirm all files are backed up and go to the "Upgrade" step.

Upgrade

Upgrade

To upgrade OpenVPN-UI to the latest version, you have to save old container image, remove old container and deploy new container with upgraded image.

Preparation
  1. Check which OpenVPN-UI version image is currently used:
bash
docker inspect --format='{{json .Config.Labels}}' d3vilh/openvpn-ui:latest
{"maintainer":"Mr.Philipp ","version":"0.5"}

Note: Old container

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptopenvpnopenvpn-adminopenvpn-configurationopenvpn-server

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言