When using starting OpenVPN as a service it does not use my /etc/openvpn/server.conf. When looking in the /var/log/syslog, I only see Started OpenVPN service. without any additional logging of OpenVPN.

When I start OpenVPN manually, openvpn --config /etc/openvpn/server.conf, I get a bunch of logging of OpenVPN and clients can connect with it.

How do I make sure that when starting it as a service, it uses the config file?

Debian GNU/Linux 9 OpenVPN 2.4.0 x86_64-pc-linux-gnu

  • 1
    What command are you using, service or systemctl? Try systemctl start openvpn@server.service since you're on Debian 9. – Q23 Aug 14 '17 at 20:54
  • I was using just service start openvpn, however the command you provided works! If you add it as an answer I can accept it. :) – joell Aug 15 '17 at 7:58
  • Got it covered. Took me a while to get used to systemctl, so I ended up having this problem often. – Q23 Aug 15 '17 at 23:58
up vote 5 down vote accepted

If you're using a systemd based OS like Ubuntu 16.04 or Debian 9, you'll need to use the systemctl command instead of service:

To enable at boot time:

systemctl enable openvpn@server.service

To start and stop manually:

systemctl start openvpn@server.service

systemctl stop openvpn@server.service

You can enable, disable, start, and stop any OpenVPN configuration this way by replacing server with the name of the .conf file in /etc/openvpn.

  • Thanks for this answer – I had to search a lot until I found that. Weird that service works though and starts OpenVPN, but it just doesn't do anything useful apparently? – slhck Jun 18 at 14:18
  • Brilliant! I tried a lot of things from other threads and nothing worked until I tried it this way! Thanks! – yuranos87 Oct 5 at 13:59

If you're running systemd, changing files like /etc/default/openvpn and /etc/init.d/openvpn not enough, will require running systemctl on/off at the boot time:

systemctl enable openvpn.service

systemctl disable openvpn.service

In any case you can manually start/stop the client:

systemctl start openvpn.service

systemctl stop openvpn.service

See status with:

systemctl status openvpn.service
New contributor
Kirill Z is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • I don't see how this answers the question. Apparently, the OP is getting OpenVPN to start. – G-Man Dec 7 at 8:21

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.