v2rayN for Linux: Choose deb/rpm Packages and Enable Startup at Login

A complete guide for Debian/Ubuntu and Fedora-based systems, covering deb and rpm packages, installation commands, desktop entries, and systemd user-service autostart.

At a Glance

This guide is for anyone who needs to run v2rayN on a Linux desktop. Start by confirming the distribution and CPU architecture, then install the deb or rpm package, check the command entry, repair the desktop menu entry, verify subscriptions and local ports, and create a systemd user service for the current account. After setup, v2rayN can launch automatically whenever the graphical session starts, with an easy-to-remove configuration.

Choosing an Installation Package: deb, rpm, and CPU Architecture

The most common cause of a failed Linux installation is not a missing dependency but the wrong package format or CPU architecture. Ubuntu, Debian, Linux Mint, and other Debian-based distributions use deb packages; Fedora, Rocky Linux, AlmaLinux, and other RPM-based distributions use rpm packages. Do not determine the package format from the desktop environment alone: GNOME, KDE Plasma, and other desktops can run on different distributions.

First, run the system-identification commands in a terminal. The first reads the distribution ID; the second reports the CPU architecture. x86_64 usually means a 64-bit x86 platform, while aarch64 or arm64 means a 64-bit ARM platform. The architecture listed on the download page must match the command output; renaming a file cannot convert it.

cat /etc/os-release
uname -m

deb Package

Recommended

Let APT handle dependencies. This is suitable for Ubuntu, Debian, and Debian-based desktop distributions. Running apt install ./filename.deb reads both the local package and dependencies from configured repositories.

Best for: Ubuntu, Debian, and Linux Mint desktops

rpm Package

Let DNF resolve dependencies. This is suitable for Fedora and distributions that use RPM package management. Keep the ./ path prefix when installing a local file so it is not interpreted as a repository package name.

Best for: Fedora, Rocky Linux, and AlmaLinux desktops

Compressed Archive

You will usually need to maintain the extraction directory, command entry, and desktop file yourself. When a deb or rpm package is available, a system package makes it easier to inspect files, upgrade, and uninstall.

Best for: environments where directory maintenance is acceptable and the package format does not match

Check Command or location Expected result
Distribution family cat /etc/os-release Use ID and ID_LIKE to determine deb or rpm
CPU architecture uname -m A specific architecture value such as x86_64 or aarch64
Graphical session printf '%s\n' "$XDG_SESSION_TYPE" Usually reports wayland or x11
User-service support systemctl --user --version Prints systemd version information

deb and rpm Installation Commands

Download the Linux package matching your system architecture from this site's download center, then open the download directory. The commands below do not hard-code a versioned filename; instead, they list candidate files in the current directory. After confirming there is only one target package, copy its complete filename into the installation command. This avoids letting an outdated filename in the guide override a newer package.

cd ~/Downloads
find . -maxdepth 1 -type f \( -name "*.deb" -o -name "*.rpm" \) -print

Debian, Ubuntu, and Derivatives

When APT installs a local deb, the ./ prefix before the filename is required. If you run apt install filename.deb directly, APT may interpret it as a package name from a repository. There is no need to unpack the file with a lower-level tool first; APT reads its dependencies and fetches any available requirements from the configured repositories.

cd ~/Downloads
sudo apt update
sudo apt install ./v2rayN-linux-64.deb

The example filename only shows the command structure; use the actual filename displayed in your download directory. After installation, query the installed contents with the package manager and check the command entry. If command -v returns an absolute path, the current account's PATH can find the program.

command -v v2rayN
dpkg -l | grep -i v2rayn
dpkg -L v2rayn | grep -E '(/bin/|\.desktop$)'

Fedora and RPM-Based Distributions

Use the ./ path for a local rpm with DNF as well. Compared with running rpm -i directly, DNF resolves dependencies available from configured repositories, making it better suited to a first desktop installation. If an enabled repository cannot provide a dependency, DNF clearly lists the missing package name.

cd ~/Downloads
sudo dnf install ./v2rayN-linux-64.rpm

Bottom line: let the package manager finish the installation before fixing the desktop entry

Dependency errors and a missing application-menu entry are two different problems. If v2rayN runs from the terminal, the main program is usually usable; fix the desktop file instead of reinstalling or extracting duplicate copies into multiple directories.

First Launch and Desktop Entry Repair

After installation, launch v2rayN once from the terminal. Terminal output preserves information about graphics libraries, permissions, configuration directories, and core processes. If the program opens normally, close it and check whether v2rayN now appears in the application menu. The menu may not refresh until you log out and back in.

v2rayN

If it opens from the terminal but is missing from the application menu, first check whether the package already includes a desktop file. For deb packages, use dpkg -L; for rpm packages, use rpm -ql. Once found, update the desktop database. If the command is unavailable, do not create an empty file just for that reason; starting a new graphical session usually refreshes the menu.

find /usr/share/applications ~/.local/share/applications \
  -maxdepth 1 -type f -iname "*v2rayn*.desktop" -print

update-desktop-database ~/.local/share/applications 2>/dev/null || true

If the package contains no desktop file, create an entry for the current account. Run command -v v2rayN first and confirm that it returns /usr/bin/v2rayN before using the content below. If the actual path differs, change Exec to the absolute path returned by the command. The desktop file goes in the user directory and will not overwrite files installed by the system package.

mkdir -p ~/.local/share/applications
cat > ~/.local/share/applications/v2rayn.desktop <<'EOF'
[Desktop Entry]
Type=Application
Name=v2rayN
Comment=V2Ray desktop client
Exec=/usr/bin/v2rayN
Terminal=false
Categories=Network;
StartupNotify=true
EOF
chmod 644 ~/.local/share/applications/v2rayn.desktop
update-desktop-database ~/.local/share/applications 2>/dev/null || true
2 package types
deb and rpm
10808
Common local SOCKS port
10809
Common local HTTP port
3 seconds
Autostart delay

Importing Subscriptions, Starting the Core, and Checking Connectivity

An open window only confirms that the graphical program has started; it does not confirm that the node, core, or system proxy is working. On first use, import the subscription, update it, select a node, and start the core in that order. A subscription URL maintains multiple nodes in bulk; a single vmess:// or vless:// link describes one node and will not receive later subscription changes automatically.

  1. Open subscription management, add the subscription URL you actually have, and give the group a recognizable note.
  2. Run a subscription update and confirm that nodes appear in the main list. If the list is empty, check the update log first instead of repeatedly toggling the system proxy.
  3. Select a node, set it as the active server, and check the core startup result in the status bar or logs.
  4. Go to “Settings” → “Parameter Settings” and record the actual SOCKS, HTTP, or mixed listening port.
  5. Enable the system proxy according to your desktop environment, then test DNS resolution and web access separately.

Use ss to check listening ports. The command below filters the common ports 10808 and 10809; if the settings page shows different ports, change the filter numbers to match. A normal result should include LISTEN and usually bind to 127.0.0.1 or another loopback address on the local machine.

ss -lntp | grep -E '10808|10809'

If the node shows as connected but webpages still do not open, distinguish between “the core is not listening” and “the desktop application is not using the proxy.” In the first case, the port will be absent from ss; check the core logs, node parameters, or port conflicts. In the second, check the system proxy state and whether the browser has separate proxy settings.

Bottom line: use the listening port and core logs to confirm startup

A tray icon, a selected node, or a minimized window does not independently prove that the proxy is ready. First confirm that the core logs show no startup errors, then verify that the configured port is listening, and finally check the desktop system proxy. This gives you the shortest troubleshooting path.

Autostart with a systemd User Service

v2rayN is a desktop application, so autostart should be tied to the current account's graphical login session rather than a system-wide root service. A systemd user service runs after the account logs in, with its configuration in ~/.config/systemd/user/; enabling it and viewing its logs require no sudo. It also will not start the same configuration automatically for other accounts.

First confirm that command -v v2rayN returns a path, then create the user service. The example uses /usr/bin/env v2rayN to locate the program in the user-service environment and waits 3 seconds for the desktop session to finish initializing. Restart=on-failure restarts it only after an abnormal exit, so closing the window normally will not relaunch it continuously.

mkdir -p ~/.config/systemd/user
cat > ~/.config/systemd/user/v2rayn.service <<'EOF'
[Unit]
Description=v2rayN desktop client
After=graphical-session.target
Wants=graphical-session.target

[Service]
Type=simple
ExecStartPre=/bin/sleep 3
ExecStart=/usr/bin/env v2rayN
Restart=on-failure
RestartSec=5

[Install]
WantedBy=default.target
EOF

After writing the service, reload the user configuration and enable it immediately. enable --now both enables “start automatically at the next login” and starts it in the current session. If v2rayN is already running manually, exit the original process first to avoid two instances competing for the same configuration directory or local ports.

systemctl --user daemon-reload
systemctl --user enable --now v2rayn.service
systemctl --user status v2rayn.service --no-pager

Autostart options: choose based on maintenance needs

systemd user service
  • Supports status checks and restart on failure
  • Logs are collected in the user journal
  • Best for a fixed desktop account running long term
Desktop autostart file
  • Integrates more directly with the graphical session
  • Best when you only need the window to start after login
  • Troubleshooting usually depends on the application's own logs

Choose a systemd user service when you need status checks, restart policies, and historical logs. If you only need the application to start after desktop login and do not need service management, use the desktop environment's autostart settings.

After completing the setup, log out of the current account and log back in. Wait at least 3 seconds, then check the service status. If it shows active (running) and the v2rayN window or tray entry appears, the login-autostart chain is complete. The user service will not create a visible window before a graphical desktop login, which is required for a desktop application.

systemctl --user is-enabled v2rayn.service
systemctl --user is-active v2rayn.service
journalctl --user -u v2rayn.service -b --no-pager -n 80

Troubleshooting and Removal

First determine whether the problem is with installation, the program entry, core connectivity, or autostart. Do not reinstall the client, delete configuration, and modify the systemd service at the same time, or the original error may be overwritten. The most effective order is to review package-manager records, run the program manually once, check the ports, and then inspect the user-service logs.

Can't find the file when installing a deb?

Run pwd and find . -maxdepth 1 -name "*.deb" -print first to confirm that the terminal is in the actual download directory. The installation command should be sudo apt install ./actual-filename.deb; do not omit ./.

It starts from the terminal, but v2rayN is missing from the application menu?

First look for the package's .desktop file, then update the desktop database and log in again. If the package has no entry, save the desktop file from this guide as ~/.local/share/applications/v2rayn.desktop and change Exec to the path returned by command -v v2rayN.

How do I fix a user service showing 203/EXEC?

This status usually means that the startup command is missing or cannot be executed. Run command -v v2rayN, then check that /usr/bin/env exists. After correcting the service, run systemctl --user daemon-reload and systemctl --user restart v2rayn.service.

The service is running, but there is no window or tray entry?

Run journalctl --user -u v2rayn.service -b -n 80 to check for graphical-session errors. Confirm that the service starts after desktop login, and keep After=graphical-session.target and the 3-second delay. Do not turn a desktop application into a system-wide root service.

How do I disable autostart completely?

Run systemctl --user disable --now v2rayn.service, delete ~/.config/systemd/user/v2rayn.service, and then run systemctl --user daemon-reload. This removes only the autostart service; it does not delete the client configuration or subscriptions.

If you need to verify the service again, first run systemctl --user reset-failed v2rayn.service to clear the previous failure state, then start it manually once. The first error in the log is usually more useful than repeated restart messages, so inspect the 80 lines before and after this startup rather than only the final line on the status page.

systemctl --user reset-failed v2rayn.service
systemctl --user restart v2rayn.service
journalctl --user -u v2rayn.service -b --no-pager -n 80
Download v2rayN View packages for your platform