Black Friday Our biggest deal of the year is coming soon Get notified →

Connect Using OpenConnect on Linux

Updated 4 Oct 2026 3 min read

This guide shows you how to connect Linux to PremierVPN with OpenConnect, the open-source AnyConnect-compatible client. You can use it from the terminal or through NetworkManager. It connects over port 443, so it often works on networks that block other VPN types.

Want a desktop app instead? PremierVPN has a native Linux app with WireGuard and a kill switch for Ubuntu and Debian and Fedora, RHEL, Rocky and AlmaLinux. The app signs in with your portal email and password.

Before you start: use your VPN credentials

Manual setups sign in with your VPN username and VPN password. These are separate from the email and password you use for the portal and the PremierVPN apps, and the portal login will not work here.

  • Find both on your Dashboard under Your VPN credentials. Click Show to reveal the password.
  • To change the VPN password, go to Settings › VPN Password. The new password applies from your next connection.
  • Not sure which login is which? See Understanding your VPN credentials.

Install OpenConnect

Ubuntu / Debian:

sudo apt install openconnect

Fedora / RHEL / Rocky / AlmaLinux:

sudo dnf install openconnect

Arch Linux:

sudo pacman -S openconnect

Connect from the terminal

sudo openconnect --user=YOUR_VPN_USERNAME uk.premiervpn.net

Enter your VPN password when asked. Keep the terminal open while you use the VPN, and press Ctrl+C to disconnect. To use another location, swap in any hostname from the table below.

Connect with NetworkManager (GNOME, KDE and others)

  1. Install the NetworkManager plugin:
    sudo apt install network-manager-openconnect-gnome

    On Fedora and similar:

    sudo dnf install NetworkManager-openconnect-gnome
  2. Open Settings › Network, and click + next to VPN.
  3. Choose Multi-protocol VPN client (openconnect).
  4. Set the VPN protocol to Cisco AnyConnect or openconnect and the Gateway to a hostname, for example uk.premiervpn.net.
  5. Click Add, then switch the VPN on. Enter your VPN username and VPN password when asked.

Run in the background

Store your VPN password in a file only root can read, then start OpenConnect in the background:

sudo install -m 600 /dev/null /etc/premiervpn-pass
printf '%s\n' 'YOUR_VPN_PASSWORD' | sudo tee /etc/premiervpn-pass > /dev/null
sudo sh -c 'openconnect --user=YOUR_VPN_USERNAME --passwd-on-stdin --background --pid-file=/run/openconnect.pid uk.premiervpn.net < /etc/premiervpn-pass'

To disconnect:

sudo kill $(cat /run/openconnect.pid)

Start the VPN at boot with systemd

Create /etc/systemd/system/premiervpn.service with this content:

[Unit]
Description=PremierVPN (OpenConnect)
After=network-online.target
Wants=network-online.target

[Service]
ExecStart=/usr/sbin/openconnect --user=YOUR_VPN_USERNAME --passwd-on-stdin --non-inter uk.premiervpn.net
StandardInput=file:/etc/premiervpn-pass
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Then enable and start it:

sudo systemctl daemon-reload
sudo systemctl enable --now premiervpn

If openconnect is installed somewhere else on your system, check the path with command -v openconnect and update ExecStart.

Server hostnames

You can also copy any hostname from the Servers page in the portal.

LocationHostname
Denmarkdn.premiervpn.net
Finlandfn.premiervpn.net
Francefr.premiervpn.net
Germanyde.premiervpn.net
Israelisr.premiervpn.net
Italyit.premiervpn.net
Netherlandsnl.premiervpn.net
Norwayno.premiervpn.net
Polandpl.premiervpn.net
Romaniaro.premiervpn.net
Spainsp.premiervpn.net
Swedensw.premiervpn.net
Switzerlandswiss.premiervpn.net
Turkeytr.premiervpn.net
United Kingdom (London)uk.premiervpn.net
Argentinaar.premiervpn.net
Brazilbr.premiervpn.net
Canadaca.premiervpn.net
Mexicomx.premiervpn.net
Perupe.premiervpn.net
United States (Kansas)ks.premiervpn.net
United States (Los Angeles)la.premiervpn.net
United States (New York)ny.premiervpn.net
United States (Santa Clara)sc.premiervpn.net
Australiaau.premiervpn.net
Hong Konghk.premiervpn.net
Indiain.premiervpn.net
Japanjp.premiervpn.net
Singaporesg.premiervpn.net
South Koreask.premiervpn.net

Troubleshooting

"Login failed" or the password is rejected

  • Use your VPN username and VPN password from the Dashboard, not your portal email and password.
  • If you use a password file, make sure it holds your current VPN password with no extra spaces.

Certificate verification failed

Our servers use a publicly trusted certificate, so this usually means the hostname is mistyped or your CA certificates are out of date. Check the hostname, then update the ca-certificates package. Don't turn off certificate checks.

Can I send only some traffic through the VPN?

By default all traffic goes through the VPN. OpenConnect can run a custom routing script (for example the third-party vpn-slice tool) through its --script option if you want split tunnelling. This is an advanced setup.

Still stuck? Open a support ticket and tell us your distribution, the command you ran and the error you see.

Something out of date or unclear? Let us know.

Stay Ahead of Online Threats

Get VPN tips, security insights, and exclusive offers delivered straight to your inbox. No spam — just the essentials.

Unsubscribe at any time. We respect your privacy.

PremierVPN Support