I want to run my openvpn as systemd service. This tutorial tells me to use openvpn@.service template for that:


 ln -s /lib/systemd/system/openvpn@.service /etc/systemd/system/openvpn@MyClient.service

I can do that but before trying I wonder that in the same folder there is also an openvpn-client@.service file, which is not even mentioned in the tutorial. I looked into both but my knowledge of systemd is limited. From what I can see, both would work running an openvpn client, just openvpn-cliemt@.service would start it with --daemon ovpn-%i. Wouldn't it be better to have it running as a daemon? Is the tutorial just outdated and not covering this .service file?


From 2.4.0, configuration moved to subdirectories: /etc/openvpn/{client,server} and the corresponding systemd units were changed from the generic openvpn@.service to openvpn-client@.service and openvpn-server@.service.

As the changelog describes it:

OpenVPN now ships with more up-to-date systemd unit files which take advantage of the improved service management as well as some hardening steps. The configuration files are picked up from the /etc/openvpn/server/ and /etc/openvpn/client/ directories (depending on unit file). This also avoids these new unit files and how they work to collide with older pre-existing unit files.

So it appears the Fedora wiki is out-of-date.

  • Thanks so I was right using the client version. It works well when I copy the conf into /etc/openvpn/clients Jul 17 '18 at 19:50
  • Debian is behind, too.
    – JdeBP
    Jul 17 '18 at 21:06
  • @JdeBP Colour me shocked... :p
    – jasonwryan
    Jul 17 '18 at 21:08
  • 1
    And what is the difference between openvpn@server and openvpn-server@server services? I can see that they both exist when using commands sudo service openvpn@server status and sudo service openvpn-server@server status. However only openvpn-server@server is used.
    – baptx
    Mar 22 '20 at 19:13

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.