Install v2rayN on Linux: DEB and RPM Packages, Autostart Setup

Install DEB packages on Debian and Ubuntu or RPM packages on Fedora, configure desktop login autostart, and troubleshoot permissions and system proxy settings.

At a glance

This guide is for Linux desktop users. Check your distribution and processor architecture, then choose the right package, install v2rayN, verify the local proxy endpoint, and configure it to start when you log in. The commands use the downloaded file rather than assuming a fixed version or package name. This desktop autostart setup is not intended for headless servers without a graphical session.

Before you install: distribution, architecture, and desktop session

On Linux, choose the Avalonia desktop version of v2rayN; the WPF version is for Windows. DEB and RPM are package formats for different distributions, not proxy protocols or core types. Run the command below in a terminal to identify your system. Your desktop environment also affects system proxy settings and autostart.

cat /etc/os-release
uname -m
printf 'Desktop: %s\nSession: %s\n' "$XDG_CURRENT_DESKTOP" "$XDG_SESSION_TYPE"

Choose the package for your distribution

Recommended

Use the available DEB package on Debian or Ubuntu, and the RPM package on Fedora. apt or dnf tracks the installation and handles declared dependencies, and you can later uninstall the package by name.

Best for: everyday desktop use with installation tracked by the system.

Linux archive

If the release only provides an archive, extract and run it as directed in that release's instructions. Don't rename the file extension to .deb or .rpm. Check the desktop launcher and executable path yourself.

Best for: distributions without a matching package, or testing a release separately.

When uname -m returns x86_64, the package is usually for x64; aarch64 usually means arm64. Debian package metadata may use amd64 for the same processor architecture. Check the current Linux downloads on the downloads page. The steps below apply only to a package in the matching format; not every release offers both formats.

Debian and Ubuntu: install a DEB package with apt

For this installation, place the package in its own directory and open a terminal there. First list the DEB files in the current directory, then enter the path to the package—for example, drag the file into the terminal. Using a variable preserves spaces in the filename. Don't select multiple older versions at once.

find "$PWD" -maxdepth 1 -type f -name '*.deb' -print
read -r -p 'Enter the full path to the DEB file: ' pkg
if [ -f "$pkg" ]; then
  dpkg-deb -f "$pkg" Package Version Architecture
  dpkg --print-architecture
else
  printf 'File not found. Select it again.\n'
fi

Check that the package architecture matches your system before installing. apt install can resolve dependencies declared by a local package, making it a better choice for most desktop users than simply unpacking the files. You need administrator authorization for the initial installation, but that does not mean you should run the client as an administrator.

if [ -f "$pkg" ]; then
  pkg="$(realpath "$pkg")"
  sudo apt update
  sudo apt install "$pkg"
fi

Fedora: install an RPM package with dnf

On Fedora, use dnf to install a local RPM package. Before installing, read its name, version, and architecture rather than assuming the application's display name is the correct package-manager identifier. The command below reads the actual file; the package name comes from its metadata, not a hard-coded value in this guide.

find "$PWD" -maxdepth 1 -type f -name '*.rpm' -print
read -r -p 'Enter the full path to the RPM file: ' pkg
if [ -f "$pkg" ]; then
  pkg="$(realpath "$pkg")"
  rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE} %{ARCH}\n' "$pkg"
  uname -m
  sudo dnf install "$pkg"
else
  printf 'File not found. Select it again.\n'
fi

Separate installation privileges from runtime privileges

During installation
  • apt or dnf needs administrator authorization to write to system directories.
  • The package manager handles dependencies declared by the package.
  • If an error occurs, keep the terminal output and identify the specific dependency or file conflict first.
At runtime
  • Launch v2rayN from the current user's desktop application list.
  • Manage subscriptions, nodes, and routing settings in the current user's environment.
  • Configure TUN permissions separately; don't run the entire desktop application as an administrator.

Don't disable system security features to work around ordinary installation errors. First determine whether the package failed to install, the application failed to start, or the proxy connection failed.

After installation, run rpm -ql "$(rpm -qp --queryformat '%{NAME}' "$pkg")" to find the program and desktop launcher files. If v2rayN appears in the application list but immediately exits, run the executable path recorded in its desktop launcher from a terminal and check for missing libraries or core startup errors. Don't keep reinstalling packages for different architectures.

First connection: subscriptions, listening ports, and system proxy

A successful installation means the client can run; it does not mean a remote connection is ready. v2rayN manages nodes and configuration, while the selected core handles the connection. VMess and VLESS are protocol names. A subscription URL retrieves a list of nodes; it is not the same as a local HTTP or SOCKS endpoint.

  1. Add a subscription

    Open “Subscription Group” → “Subscription Group Settings,” add a group, and enter a subscription URL you trust. Button locations can vary by version; use the group management option in your current interface.

  2. Update the list

    Choose the update option from the “Subscription Group” menu. Before you have a connection, select an update method that doesn't use a proxy. If the URL can't be reached directly, you'll need to establish a working connection first; repeatedly clicking update won't help.

  3. Select a node

    Choose a node from the list and set it as the active server. Make sure its protocol and transport settings match the server requirements, then check the log for the core startup result.

  4. Check the port

    Go to “Settings” → “Parameter Settings” and check the local listening address and port. This guide uses 127.0.0.1:10808 as an example of a mixed-protocol endpoint. If your interface shows a different port, use that value in all subsequent tests.

  5. Set the proxy

    Test an explicit proxy connection first, then try the client's “System Proxy” → “Set System Proxy” option. On Linux, which apps use it depends on the desktop environment and whether each app reads the corresponding settings.

10808
Example mixed-protocol listening port
127.0.0.1
Loopback address for local use only
15 seconds
Timeout limit for the request tests below

These values are examples, not performance benchmarks or defaults for every version. Test with both protocols only after confirming the endpoint supports HTTP and SOCKS. socks5h tells curl to send the destination hostname to the proxy for resolution, which can help distinguish local DNS issues from proxy connection problems.

ss -ltnp 'sport = :10808'
curl --noproxy "" --proxy http://127.0.0.1:10808 \
  --max-time 15 --head https://example.com
curl --noproxy "" --proxy socks5h://127.0.0.1:10808 \
  --max-time 15 --head https://example.com

Start at desktop login: reuse the existing desktop launcher

Here, “start on boot” means start after you log in to the graphical desktop. It does not run a background service at system startup or provide a proxy at the login screen. Run the client and verify it manually first, then add it to autostart. That way, the same configuration error won't be triggered again at every login.

Prefer the desktop file included with the package. It usually has the correct Exec path and required arguments, making it more reliable than guessing where the executable is. The command below searches standard application directories for launchers. If you find more than one, inspect each and choose only the one belonging to this installation.

find /usr/share/applications "$HOME/.local/share/applications" \
  -maxdepth 1 -type f -iname '*v2rayn*.desktop' -print 2>/dev/null

read -r -p 'Enter the full path to the verified desktop file: ' desktop_file
if [ -f "$desktop_file" ]; then
  grep -E '^(Type|Name|Exec|TryExec|Hidden|OnlyShowIn|NotShowIn)=' "$desktop_file"
fi

Before copying the file, confirm that Type=Application is set, Exec points to the installed program, and nothing prevents it from launching in your current desktop. The destination is the current user's XDG autostart directory, so this command doesn't need sudo. If the old file contains Hidden=true, find out why it was disabled before copying it.

if [ -f "$desktop_file" ]; then
  autostart_dir="${XDG_CONFIG_HOME:-$HOME/.config}/autostart"
  mkdir -p "$autostart_dir"
  cp -- "$desktop_file" "$autostart_dir/v2rayN.desktop"
fi

Current user's autostart

Directory
$XDG_CONFIG_HOME/autostart, or ~/.config/autostart if unset
When it starts
When you log in to an XDG autostart-compatible graphical desktop
Runs as
The current desktop user
Launcher source
The desktop file included with this installation package

This guide uses this approach for an interactive desktop client.

System startup service

When it starts
A target specified by system startup or the service manager
Graphical session
May not be available at startup
What it runs
A background process designed with appropriate permissions
In scope for this guide
The v2rayN desktop window is not configured as a system service

Don't put a desktop client's launch command directly into a system service and expect its window to appear normally.

Permissions and system proxy: troubleshoot by symptom

The local proxy, desktop system proxy, and TUN operate at different levels. An app can connect to a local port over HTTP or SOCKS; desktop proxy settings provide information to apps that choose to read them; TUN involves a virtual network device, routing, and additional permissions. Verify the local proxy first, then expand the scope to reduce troubleshooting steps.

SymptomCheck firstWhat to do
Connection to local port refusedss -ltnp, listening port, core logsMake sure the core has started, the port isn't already in use, and the test address matches the setting in the interface.
curl works, but the browser doesn'tBrowser proxy settings and desktop proxy settingsCheck that the browser uses the system proxy, or configure the local endpoint directly in the browser.
Desktop apps work, but terminal traffic isn't proxiedEnvironment variables in the current shellSet a proxy as needed for each command. Desktop proxy settings don't automatically apply to every terminal app.
TUN reports insufficient permissionsLinux TUN permissions for your current versionGrant permissions to the required components as documented for your version. Don't recursively change permissions on the entire installation directory.
Fails to start after loginThe desktop file's Exec entry and logsCheck whether an upgrade changed the path, the session is available, or autostart entries are duplicated.

On GNOME, go to “Settings” → “Network” → “Network Proxy” to check manual proxy settings. HTTP and HTTPS proxy fields can point to a local endpoint that supports HTTP; the SOCKS field should point to an endpoint that supports SOCKS. The HTTPS proxy field usually still takes the host and port of a local HTTP proxy—it does not mean the local endpoint needs to provide TLS. Other desktop environments have their own settings; don't copy GNOME-specific commands directly.

# Affects only this terminal and processes started from it
export http_proxy=http://127.0.0.1:10808
export https_proxy=http://127.0.0.1:10808
export all_proxy=socks5h://127.0.0.1:10808

# Clear these settings after testing
unset http_proxy https_proxy all_proxy
Why can't some apps connect after I exit v2rayN?

Those apps may still be pointing to a local port that is no longer listening. Before exiting, turn off the system proxy or restore its previous setting. Also check custom browser proxy settings and shell environment variables. Proxy settings are separate state; don't assume every desktop environment restores them automatically when the program exits.

Do I need to open port 10808 in the firewall?

For local use only, the endpoint should bind to a loopback address; you generally don't need to expose this port externally. Listening on all network interfaces expands access. Don't do that unless you specifically need to share the proxy on your local network and have access controls in place.

Do I need to recreate the autostart entry after an upgrade?

Usually not, if the installation path and the desktop file's launch arguments haven't changed. If the client stops starting, compare the new launcher with the autostart copy, including the Exec and TryExec fields. A copy in your user directory won't necessarily be updated when the system application launcher changes.

Download v2rayN