Wait! We Have a Special Deal!

Get CactusVPN for $3.5/mo!

Save 64% Now
30-Day Money-Back Guarantee
Setup Tutorials

How to set up OpenVPN on Ubuntu through command line

Go step-by-step through following instructions to set up OpenVPN on Ubuntu from command line.

  1. Click on the Menu button and type Terminal in order to open the terminal.

    How to set up OpenVPN on Ubuntu from command line: Step 1

  2. In the terminal, type:

    sudo apt-get -y install openvpn unzip

    How to set up OpenVPN on Ubuntu from command line: Step 2

  3. Create a folder and access it from the terminal:

    mkdir CactusVPN && cd CactusVPN

    How to set up OpenVPN on Ubuntu from command line: Step 3

  4. Go to our Downloads page, find the OpenVPN Configuration Files box and download the OpenVPN configuration files.

    How to set up OpenVPN on Ubuntu from command line: Step 4

  5. Type:

    wget https://billing.cactusvpn.com/downloads/openvpn-configs/CactusVPN-OpenVPN-Config.zip

    How to set up OpenVPN on Ubuntu from command line: Step 5

  6. Unzip the OpenVPN configuration files. Type:

    unzip CactusVPN-OpenVPN-Config.zip

    How to set up OpenVPN on Ubuntu from command line: Step 6

  7. Go to /etc/resolv.conf and add this line at the top:

    nameserver 8.8.8.8

    Save and close this file:

    sudo nano /etc/resolv.conf 

    How to set up OpenVPN on Ubuntu from command line: Step 7

  8. Connect to a VPN server using OpenVPN configuration files:

    sudo openvpn --config AU-Sydney-CactusVPN-UDP.ovpn

    How to set up OpenVPN on Ubuntu from command line: Step 8

  9. Fill in the Username and Password using your VPN username and password.

    You can find your VPN username and password in your account on our website, by going to Settings -> VPN Username & Password. Make sure you use your VPN username and password and NOT the website account credentials (What is the difference?).

    When you have the message Initialization Sequence Completed you are connected to VPN.

    How to set up OpenVPN on Ubuntu from command line: Step 10

To close the VPN connection to this VPN Server type CTRL + c in this Terminal.

VPN and Smart DNS Services

Protect online privacy, secure your connection and access blocked websites

Try CactusVPN For Free

Special Deal