Skip to main content

Mysterium VPN guide for Linux (Ubuntu and Debian)

A thorough installation guide for Linux CLI

A Linux command-line client for connecting to Mysterium VPN with WireGuard. Sign in through your browser, choose a country, and manage your VPN connection from the terminal.
​

Quick start

You need Linux with WireGuard kernel support, Bash, and curl. The installer installs missing dependencies on supported distributions and requests sudo access when needed. You do not need Go to use a release build.
​

1. Install the latest release.

curl -fsSL https://github.com/mysteriumnetwork/mysteriumvpncli/releases/latest/download/install.sh | bash

2. Sign in.

sudo mystvpn auth

Open the URL printed in the terminal, sign in, and approve access. The command waits for approval; the link expires after five minutes.

3. Connection — Using Quick Connect feature

sudo mystvpn connect

Note: By default, the CLI connects through a Residential IP in Germany. To connect from a different location or use another IP type, refer to the country and city (optional) selection commands in Step 4 below.​

4. Choosing a Specific Country, City (optional) and IP type to connect.

sudo mystvpn countries --ip-type residential
sudo mystvpn connect --country DE --ip-type residential

Note: You can replace DE with a country code from the list. You can also use hosting instead of residential for both commands.

​5. Optional - Choosing a Specific City?

You can expand the list of cities under each country to choose a more precise connection location based on your preferences, for both Hosting and Residential IP types:

sudo mystvpn cities --country DE --ip-type residential
sudo mystvpn connect --country DE --city berlin --ip-type residential

​6. Check your connection or disconnect.

sudo mystvpn status
sudo mystvpn disconnect

Note: Use the same operating-system user for authentication and all VPN commands. The examples use sudo consistently because creating WireGuard interfaces requires privileges. If you are already root, omit sudo. The CLI does not elevate privileges automatically.

Installation

Automatic installer (recommended)

The quick start command detects your architecture and chooses an installation method:

System

Installation method

Executable

Debian, Ubuntu, or another apt-based system

Debian package, installed through apt

/usr/bin/mystvpn

Other supported Linux distributions

Standalone binary from the release archive

/usr/local/bin/mystvpn

If the latest release has no Debian package, the installer falls back to the standalone binary. It verifies SHA-256 checksums before installing either format. Download, checksum, and apt failures stop installation.

For custom destinations and dependency details, see Advanced setup. If you previously installed a standalone binary on an apt-based system, see Switching from standalone to a Debian package.

Install from the APT repository

On Debian, Ubuntu, or another apt-based system, add the Mysterium repository and install mystvpn:

curl -fsSLo repository-key.asc https://repository.mysterium.network/repository-key.asc
sudo install -d -m 0755 /etc/apt/keyrings
sudo install -m 0644 repository-key.asc /etc/apt/keyrings/mysterium.asc
sudo tee /etc/apt/sources.list.d/mysterium.sources >/dev/null <<'EOF'
Types: deb
URIs: https://repository.mysterium.network
Suites: stable
Components: main
Signed-By: /etc/apt/keyrings/mysterium.asc
EOF
sudo apt update
sudo apt install mystvpn

Once configured, the repository provides future updates through apt. If you previously installed a standalone binary, see Switching from standalone to a Debian package.

Install a Debian package manually

Download the .deb for your system from GitHub Releases. Check your Debian architecture with:

dpkg --print-architecture

Install the downloaded file with apt. For example:

sudo apt install ./mystvpn_1.2.3_amd64.deb

Replace the example filename with the file you downloaded. Apt installs the runtime dependencies and places the executable at /usr/bin/mystvpn.

Supported architectures

The automatic installer selects the correct architecture for you. When downloading files manually, use these names:

Linux architecture (uname -m)

Archive filename

Debian architecture

x86_64 / amd64

mystvpn-linux-amd64.tar.gz

amd64

aarch64 / arm64

mystvpn-linux-arm64.tar.gz

arm64

armv7l / armv8l (32-bit ARM, ARMv7 or later)

mystvpn-linux-arm32.tar.gz

armhf

Debian filenames follow mystvpn_<version>_<architecture>.deb.

Everyday use

Command reference

Command

What it does

mystvpn help

Show command descriptions and quick-start examples. Running mystvpn alone also shows help.

mystvpn help connect

Show a command's usage, flags, defaults, and examples. Also accepts mystvpn connect --help or -h.

mystvpn help config profile create

Show help for a nested subcommand. Also accepts mystvpn config profile create --help.

mystvpn version

Show the installed version.

sudo mystvpn auth

Sign in through browser approval.

sudo mystvpn config profile list

List profiles, marking the active selection with *.

sudo mystvpn config profile create us-1

Create a profile using built-in defaults.

sudo mystvpn config profile use us-1

Select the profile for the next connect or refresh.

sudo mystvpn config profile current

Print the selected profile's name.

sudo mystvpn config profile delete us-1

Delete an inactive profile.

sudo mystvpn config

Print the selected profile's saved overrides as JSON.

sudo mystvpn config effective

Print its effective settings, including built-in defaults.

sudo mystvpn config --profile us-1 set country US

Save a setting for a specific profile.

sudo mystvpn config --profile us-1 get country

Read a setting for a specific profile.

sudo mystvpn config unset country

Remove a saved override.

sudo mystvpn config path

Print the config file location.

sudo mystvpn countries --ip-type residential

List available country codes for an IP type.

sudo mystvpn cities --country DE --ip-type residential

List available city/state identifiers in a country.

sudo mystvpn connect --country DE --city berlin --ip-type residential

Connect to a city/state within a country.

sudo mystvpn connect --country DE --ip-type residential

Connect to a country, replacing any active connection.

sudo mystvpn status

Show the locally saved connection status.

sudo mystvpn refresh

Reconnect using the selected profile and saved WireGuard keypair.

sudo mystvpn disconnect

Disconnect the VPN.

sudo mystvpn logout

Disconnect and remove stored authentication tokens.

Configuration and profiles

Connections default to Germany (DE) with residential IPs. After signing in, run sudo mystvpn connect to use these defaults.

Create and select a reusable preset:

sudo mystvpn config profile create us-1
sudo mystvpn config --profile us-1 set country US
sudo mystvpn config --profile us-1 set ip_type hosting
sudo mystvpn config profile use us-1

The selection persists across runs. Apply it with sudo mystvpn connect, or sudo mystvpn refresh if already connected. Selecting a profile alone leaves the running connection unchanged.

Use --profile <name> before set or get to target a specific profile; omit it to use the selected profile. config unset <key> restores a setting's default. config shows saved settings, and config effective includes defaults.

For a single connection, connect --profile us-1 uses that preset without changing the selection. Flags such as --country CA override its settings.

Choose or change a location

List countries for the IP type you want:

sudo mystvpn countries --ip-type residential
sudo mystvpn countries --ip-type hosting

Country codes are listed alphabetically, with up to ten codes per line.

To connect, provide a two-letter country code and an IP type (residential or hosting) through saved defaults or explicit flags:

sudo mystvpn connect --country NL --ip-type residential

To narrow a country to a city (or state where the service provides states), list its targets and pass the exact identifier to --city:

sudo mystvpn cities --country DE --ip-type residential
sudo mystvpn connect --country DE --city amsterdam --ip-type residential
sudo mystvpn config set city amsterdam
sudo mystvpn config get city
sudo mystvpn config unset city

Run connect again with another country or IP type to replace the active connection. You do not need to disconnect first.

The client requests the new configuration before bringing the existing tunnel down.

A successful connection prints:

exit_ip: 1.2.3.4
country: NL
city: amsterdam

Check or refresh a connection

sudo mystvpn status

Example output:
​

Status reads local state without making an API request; it is not a live connectivity check. With no active session, it prints Connected: no.

To reconnect using the selected profile:

sudo mystvpn refresh

Refresh reuses the saved WireGuard keypair and prints the new connection metadata. It requires an active session.

Disconnect or sign out

sudo mystvpn disconnect

Disconnect closes the remote connection, brings down the local WireGuard tunnel, and removes the managed configuration and active session state.

To also remove your stored authentication tokens:

sudo mystvpn logout

Logout disconnects an active tunnel locally and remotely before removing tokens.

Updating

Note: The CLI periodically checks for newer versions and notifies you when an update is available. Updates are installed using the same method you originally used to install the CLI.
​
However, the client does not automatically replace the installed version.

Update with the installer

Rerun the quick start installation command to install the latest release. On apt-based systems, it upgrades the Debian package; for standalone installations, it replaces the binary in the installation directory.

If you used MYSTVPN_INSTALL_DIR, use the same setting again when updating (see Custom installation directory). The installer chooses its method on each run rather than detecting how you previously installed the program.

Check the installed version afterward:

mystvpn version

Update from the APT repository

If you configured the APT repository, update the package with:

sudo apt update
sudo apt install --only-upgrade mystvpn

Update a manually installed Debian package

Download the newer .deb from GitHub Releases and run sudo apt install ./<downloaded-filename>.deb with its actual filename. You can also use the automatic installer.

Switching from standalone to a Debian package

An older /usr/local/bin/mystvpn can take precedence over the packaged /usr/bin/mystvpn. The installer warns about this but leaves the old file in place.

After installing the Debian package, remove the previous standalone binary:

sudo rm /usr/local/bin/mystvpn
hash -r
mystvpn version

If you used a custom directory, remove that old copy instead. Use command -v mystvpn to check which executable your shell finds.

Advanced setup

Custom installation directory

Set MYSTVPN_INSTALL_DIR to an absolute path:

curl -fsSL https://github.com/mysteriumnetwork/mysteriumvpncli/releases/latest/download/install.sh | MYSTVPN_INSTALL_DIR="$HOME/.local/bin" bash

This selects standalone installation even on apt-based systems. Add the directory to your PATH or invoke the binary by its full path. If sudo does not search your custom directory, use the full path for every command, for example:

sudo "$HOME/.local/bin/mystvpn" auth
sudo "$HOME/.local/bin/mystvpn" connect --country DE --ip-type residential

A writable installation directory avoids needing root to copy the binary, but installing system dependencies and managing the VPN can still require privileges.

Dependencies

All installation methods require a Linux kernel with WireGuard support. The installer does not change or upgrade the kernel.

Purpose

Required tools or packages

WireGuard tunnel

wireguard-tools (wg and wg-quick)

Network configuration

iproute2 (called iproute on some distributions) and sysctl from procps / procps-ng

DNS configuration

resolvconf or openresolv

Routing rules

nftables or iptables

HTTPS downloads

curl and CA certificates

Standalone archive installation

Bash, tar, gzip, and coreutils

The Debian package declares its runtime dependencies so apt can install them. For standalone installation, the installer checks for required commands and installs missing packages using apt-get, dnf, yum, pacman, or zypper. On other distributions, install missing dependencies manually and rerun it. Bash and curl must already be available to run the installation command.

Uninstall the CLI

Before removing the executable, run the following in the same privilege context you have been using to disconnect and remove authentication data:

sudo mystvpn logout

If logout reports an error, resolve it before removing the CLI so you can finish cleaning up the active connection.

Debian package installation: use apt to remove the installed package. To confirm the package name for the default executable path:

dpkg -S /usr/bin/mystvpn

Remove the package with sudo apt remove mystvpn.

Standalone installation: remove the binary from its installation location. If you confirmed that it is the standalone executable installed at the default path:

sudo rm /usr/local/bin/mystvpn
hash -r

Note:

  • Do not assume deleting the executable or removing a package also removes all user configuration files.

  • Do not share leftover configuration or session files; they may contain sensitive information.

Troubleshooting

Installation and system requirements

Problem

How to identify it

What to do

mystvpn: command not found

Your terminal cannot find mystvpn.

Run command -v mystvpn. Check /usr/bin/mystvpn for a package installation or /usr/local/bin/mystvpn for a default standalone installation. Check that the relevant directory is on your PATH, or rerun the official installer if installation did not complete.

Installer fails

The installer reports a download, checksum, package, or dependency error.

Check internet access, system compatibility, and the exact error. Retry the official installer after resolving the cause. Do not bypass checksum verification. Contact Support if verification keeps failing.

Debian package installation fails

apt reports package or dependency errors.

Run dpkg --print-architecture, confirm the downloaded package matches, and check that your repositories and dependencies are available. Resolve the reported error and retry sudo apt install ./ACTUAL_DOWNLOADED_FILENAME.deb.

Missing WireGuard support

The system cannot create a WireGuard tunnel, or reports an unsupported protocol or missing module.

Check your kernel's WireGuard support and install the required tools. On systems using a loadable module, sudo modprobe wireguard can help diagnose availability; some kernels have built-in support instead. Ask your system administrator or hosting provider about kernel support if needed. The installer does not upgrade the kernel.

wg-quick is missing

A command reports it cannot find wg-quick; command -v wg-quick finds nothing.

Install the tools with sudo apt install wireguard-tools, or rerun the installer to resolve supported missing dependencies.

Permission denied

Tunnel creation or removal fails because of permissions.

Use sudo consistently. Confirm that your user has the necessary sudo access and that the environment allows network interface management. Restricted containers may need administrator changes.

An older standalone binary takes precedence

The version remains old after installing a newer Debian package.

Follow the steps in "Switching from standalone to a Debian package".

Authentication and subscription

Problem

How to identify it

What to do

Authentication required

The CLI reports missing authentication.

Run sudo mystvpn auth, complete browser approval, and retry using the same privilege context.

Authentication link expired

Approval was not completed within five minutes, or the activation is reported as expired.

Run sudo mystvpn auth again and approve the new link before it expires.

Authentication rejected

The browser activation is rejected.

Start a new authentication flow and complete approval.

Authentication fails

The CLI reports an authentication or HTTP error.

Check internet connectivity and access to the approval page, then retry. Contact Support if it persists.

Stored authentication expires

Automatic token renewal fails.

Run sudo mystvpn auth again, approve authentication, and retry your command.

No active subscription

The API reports no active VPN subscription.

Check your subscription and make sure you signed in to the correct Mysterium VPN account. If necessary, log out and authenticate with the correct account.

IP type unavailable for your plan

The API says the chosen IP type is not permitted.

Choose an IP type included in your subscription: residential or hosting.

Commands run under different Linux users

Authentication or connection state appears to be missing between commands.

Use the same Linux user and privilege context for every authenticated operation. Authenticate again in that context if needed.

Country and IP availability

Problem

How to identify it

What to do

Country unavailable

The selected country is not available for the selected IP type.

Run sudo mystvpn countries --ip-type residential or sudo mystvpn countries --ip-type hosting, as appropriate, and choose a listed country.

Invalid country

The CLI rejects your country value.

Use a two-letter country code such as DE.

Invalid IP type

The CLI rejects your IP-type value.

Use exactly residential or hosting.

No suitable IP available

The API cannot assign an IP in your chosen country and IP type.

Retry later, select another listed country, or select another IP type included in your plan.

Refresh returns the same IP

Refresh succeeds, but the exit IP stays the same.

This can happen: refresh does not guarantee a new IP. Retry later or connect to another available country.

Refresh fails due to IP availability

The API cannot assign a suitable IP during refresh.

Retry later or use connect with another available country or eligible IP type.

Connections, local state, and WireGuard

Problem

How to identify it

What to do

No active session

refresh or disconnect cannot find an active session.

If you want to connect, run sudo mystvpn connect --country DE --ip-type residential, substituting available values. If you intended only to disconnect, confirm you used the original user and privilege context and inspect the actual tunnel state; do not create a new session just to clear the message.

Location change fails

A new connect command fails while replacing an active connection.

Review the error, run sudo mystvpn status, and check actual connectivity. Retry after resolving the cause. If necessary, use sudo mystvpn disconnect followed by connect.

Invalid local session

The CLI cannot read or validate saved session information.

Use the original user and privilege context and try re-establishing a connection with connect. If the error persists, contact Support instead of manually editing sensitive state files.

Invalid WireGuard configuration

The CLI cannot read or validate its managed configuration.

Retry the connection. Do not manually modify or share configuration files containing private keys. Contact Support if the error persists.

VPN tunnel fails to start

The CLI reports a wg-quick up failure.

Check installed dependencies, WireGuard kernel support, permissions, and conflicts with other VPNs or networking tools. Resolve the specific WireGuard error and retry.

VPN tunnel fails to stop

The CLI reports a wg-quick down failure.

Check interface state with ip link show and WireGuard state with sudo wg show. Confirm permissions, resolve the reported network issue, and retry sudo mystvpn disconnect. Avoid removing unrelated interfaces.

Status shows disconnected

sudo mystvpn status returns Connected: no.

Verify the user and privilege context, then connect again.

Status shows connected, but internet does not work

Local session information exists, but traffic fails.

Remember that status is not a live tunnel check. Inspect sudo wg show for handshake and transfer information, and check DNS resolution with getent hosts example.com. If appropriate, disconnect and check normal internet access, then reconnect. Address DNS, dependency, or network errors before retrying.

Contact Support

If the issue continues, contact Mysterium VPN Support through the Help Center and include:

  • Your Linux distribution and version.

  • The output of mystvpn version.

  • The command that failed and its exact terminal error.

  • Your selected country and IP type.

  • Whether wg-quick is installed (command -v wg-quick).

  • Whether normal internet access works when disconnected.

  • Whether you used the automatic installer or installed manually.

Note:

  • Make sure to remove sensitive information before sending logs or screenshots.

  • Do not attach authentication links, tokens, private keys, generated WireGuard configurations, or local session files.


Security

  • Authentication uses a browser approval URL; the CLI does not open the browser automatically. Access and refresh tokens are saved in owner-only files in the current user's configuration directory, along with pending activation state.

  • Access tokens are attached automatically to API calls. An unauthorized response triggers one refresh-token exchange and one retry.

  • The app-owned WireGuard keypair, active session, and generated configuration have owner-only permissions. Connection replacements and refreshes reuse the keypair and managed configuration path.

  • WireGuard private keys and authentication tokens are never included in normal command output or debug HTTP logs.

  • The generated WireGuard configuration contains the private key. Do not copy it or make it accessible to other users.

  • Refresh and disconnect accept only WireGuard configuration paths managed by mystvpn.

Did this answer your question?