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

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.

| improve this answer | |
  • 1
    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 '18 at 14:18
  • Brilliant! I tried a lot of things from other threads and nothing worked until I tried it this way! Thanks! – yuranos Oct 5 '18 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
| improve this answer | |
  • I don't see how this answers the question. Apparently, the OP is getting OpenVPN to start. – G-Man Says 'Reinstate Monica' Dec 7 '18 at 8:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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