# How to auto start openvpn (client) on Ubuntu CLI?

Uncategorized @ 23 September 2024

The openvpn package comes with an init script /etc/init.d/openvpn. This script automatically sets up connection for every .conf (mind the extension) file in /etc/openvpn.

If you install OpenVPN via an RPM or DEB package on Linux, the installer will set up an initscript. When executed, the initscript will scan for .conf configuration files in /etc/openvpn, and if found, will start up a separate OpenVPN daemon for each file.

sudo nano /etc/default/openvpn

Uncomment AUTOSTART="all"

If you’re running systemd you will need to run systemctl daemon-reload before restarting the service

sudo service openvpn enable

sudo service openvpn stop

sudo service openvpn start

Comments are closed.