How do I autostart openvpn?

I installed OpenVPN with dietpi-software. Is there a recommended way to autostart openvpn with my configuration on boot?

Here’s how I start openvpn manually:

openvpn --auth-nocache --config .vpn_conf/pia.ovpn


I tried following this post which says to:

systemctl enable openvpn@<your configuration file name>

But that isn’t right, because when I run it, I get an error:

systemctl enable openvpn@/root/.vpn_conf/pia.ovpn                                                                             
Failed to execute operation: Invalid argument

But maybe openvn is already setup a service? (sorry - I’m not too familiar with systemctl).

systemctl | ag 'openvpn'

openvpn.service            loaded active exited    OpenVPN service
openvpn@server.service     loaded active running   OpenVPN connection to server
system-openvpn.slice       loaded active active    system-openvpn.slice

It’s worth pointing out that I started openvpn directly with --deamon mode prior to this.

That leaves me wondering:

  • Why is systemctl showing some openvpn entries?
  • What should I do to get openvpn booting with my conf on startup?