Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have an *.ovpn file that works if I type in

sudo openvpn client.ovpn

Now I would like to start up openvpn when I boot the computer. It's a headless version of ubuntu if that matters. 12.04 64bit.

How can I do this?


share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

It would be nice to have a un hacker way of doing it, but this will have to do for now.

1) Create file myopenvpn in /etc/init.d/

nano /etc/init.d/myopenvpn

2) Insert into myopenvpn and save:

# OpenVPN autostart on boot script

start on runlevel [2345]
stop on runlevel [!2345]


exec /usr/sbin/openvpn --status /var/run/openvpn.client.status 10 --cd /etc/openvpn --config /etc/openvpn/client.conf --syslog openvpn

SOURCE: http://www.hackerway.ch/2012/12/11/how-to-auto-start-openvpn-client-in-debian-6-and-ubuntu-12-04/#comment-79

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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