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 |
|
Other supported Linux distributions | Standalone binary from the release archive |
|
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 ( | Archive filename | Debian architecture |
|
|
|
|
|
|
|
|
|
Debian filenames follow mystvpn_<version>_<architecture>.deb.
Everyday use
Command reference
Command | What it does |
| Show command descriptions and quick-start examples. Running |
| Show a command's usage, flags, defaults, and examples. Also accepts |
| Show help for a nested subcommand. Also accepts |
| Show the installed version. |
| Sign in through browser approval. |
| List profiles, marking the active selection with |
| Create a profile using built-in defaults. |
| Select the profile for the next connect or refresh. |
| Print the selected profile's name. |
| Delete an inactive profile. |
| Print the selected profile's saved overrides as JSON. |
| Print its effective settings, including built-in defaults. |
| Save a setting for a specific profile. |
| Read a setting for a specific profile. |
| Remove a saved override. |
| Print the config file location. |
| List available country codes for an IP type. |
| List available city/state identifiers in a country. |
| Connect to a city/state within a country. |
| Connect to a country, replacing any active connection. |
| Show the locally saved connection status. |
| Reconnect using the selected profile and saved WireGuard keypair. |
| Disconnect the VPN. |
| 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 |
|
Network configuration |
|
DNS configuration |
|
Routing rules |
|
HTTPS downloads |
|
Standalone archive installation | Bash, |
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 |
| Your terminal cannot find | Run |
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 |
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, |
| A command reports it cannot find | Install the tools with |
Permission denied | Tunnel creation or removal fails because of permissions. | Use |
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 |
Authentication link expired | Approval was not completed within five minutes, or the activation is reported as expired. | Run |
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 |
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: |
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 |
Invalid country | The CLI rejects your country value. | Use a two-letter country code such as |
Invalid IP type | The CLI rejects your IP-type value. | Use exactly |
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 |
Connections, local state, and WireGuard
Problem | How to identify it | What to do |
No active session |
| If you want to connect, run |
Location change fails | A new | Review the error, run |
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 |
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 | 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 | Check interface state with |
Status shows disconnected |
| 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 |
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-quickis 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.






