Install v2rayN on Linux: DEB/RPM Setup and Autostart

Install v2rayN on Debian, Ubuntu, or Fedora, resolve dependencies, set up desktop and login autostart, and fix common permission errors.

At a glance

This guide is for users running v2rayN on a Linux desktop. First, check your distribution and processor architecture, then install the local package with apt or dnf. After verifying that the app runs manually, reuse the desktop entry provided by the package to set up autostart at login. Finally, check the listening port, proxy requests, and desktop session separately—software installation, a working proxy connection, and autostart are three different things.

1. Check your distribution, architecture, and desktop session

Choose a Linux package from the client downloads page. Debian, Ubuntu, and their derivatives generally use DEB packages; Fedora uses RPM. The package format and processor architecture must both match: x86_64 is x64, and aarch64 is ARM64. Don’t guess the architecture based on your computer’s brand.

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

Debian / Ubuntu

Package format
deb
Package manager
apt
x64 architecture
amd64
ARM64 architecture
arm64

When you install a local package with apt, it can resolve dependencies from your configured repositories.

Fedora

Package format
rpm
Package manager
dnf
x64 architecture
x86_64
ARM64 architecture
aarch64

RPM is a package format; dnf handles installation and makes it easier to resolve repository dependencies.

The steps below assume you’re logged in to a graphical desktop such as GNOME or KDE. A command-line-only server has no desktop session, so desktop autostart instructions won’t apply. v2rayN is a graphical client; the proxy core handles connections and forwarding. Installing the client doesn’t enable the proxy by itself.

2. Debian / Ubuntu: Install a DEB and resolve dependencies

Open your Downloads folder in the file manager, then choose “Open in Terminal.” Put the DEB you’re installing in its own directory so the command can’t pick up an older version or another package. Run these commands in Bash: first check that the current directory contains exactly one DEB, then inspect and install it. The variables exist only in the current terminal session.

mapfile -d '' packages < <(find . -maxdepth 1 -type f -name '*.deb' -print0)
if [ "${#packages[@]}" -eq 1 ]; then
  deb_file="${packages[0]}"
  dpkg-deb -f "$deb_file" Package Version Architecture
  sudo apt update
  sudo apt install "$deb_file"
else
  printf 'Leave only the DEB package you want to install in the current directory.\n'
fi

Check the package name, version, and architecture in the output before confirming the installation. The ./ prefix identifies a local file; without a path, apt may interpret the argument as a repository package name. If the architecture doesn’t match, choose the correct package instead of forcing the install.

  1. Check package details

    Review the output of dpkg-deb -f to confirm that you downloaded the v2rayN package and that its architecture matches your system.

  2. Install and resolve dependencies

    Run sudo apt install "$deb_file". If an earlier dpkg install left packages unconfigured, run sudo apt --fix-broken install and review the proposed changes before proceeding.

  3. Check the desktop entry

    After installation, open the app menu and search for v2rayN. Don’t start by adding write permissions recursively to the program directory.

  4. Launch as a regular user

    Launch v2rayN as your logged-in user. Once the main window and logs look normal, configure your subscription and login autostart.

3. Fedora: Install an RPM with dnf

As before, open Bash in a directory containing only the package you’re installing. Use rpm -qp to inspect its metadata, then install it with dnf. Querying a local package doesn’t install it and doesn’t require administrator privileges.

mapfile -d '' packages < <(find . -maxdepth 1 -type f -name '*.rpm' -print0)
if [ "${#packages[@]}" -eq 1 ]; then
  rpm_file="${packages[0]}"
  rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE} %{ARCH}\n' "$rpm_file"
  sudo dnf install "$rpm_file"
else
  printf 'Leave only the RPM package you want to install in the current directory.\n'
fi

Don’t use rpm --nodeps to skip dependency checks. The package may appear to install successfully but fail to launch because a shared library is missing. If you hit a dependency error, check the package names and version constraints reported by dnf. If the required version isn’t in your repositories, check that your system version is compatible with the package.

Installing a local DEB or RPM doesn’t necessarily add a repository for ongoing updates. Whether future upgrades arrive with system updates depends on whether the package configures a repository. If it doesn’t, download and install each new package manually.

4. First launch: Check the listener, then test the proxy

Launch v2rayN from the app menu, import a subscription or node configuration you own, and select an available node. Then check the local listening settings under “Settings” → “Parameter Settings.” The sections may move between versions, so use the port and protocol shown in your current interface.

10808
Example port used in the checks below
127.0.0.1
Loopback address for local connections only
15 seconds
Maximum timeout for a single proxy request

The examples below assume a local SOCKS or mixed listener on port 10808. This is only an example, not a guaranteed default across all versions. If your port differs, change the number in the command before running it. socks5h lets the proxy resolve the destination hostname, reducing interference from local DNS during this test.

ss -lntp 'sport = :10808'
curl --proxy socks5h://127.0.0.1:10808 \
  --connect-timeout 5 --max-time 15 \
  --head https://example.com/

A website opening in your browser doesn’t mean your terminal automatically uses the system proxy. The curl command above specifies the proxy explicitly and doesn’t rely on desktop proxy settings. For a first-time setup, complete this one-off test before enabling the system proxy or TUN as needed. A regular local proxy doesn’t require running the entire graphical client as root.

5. Autostart at login: Reuse the package’s desktop entry

Here, “autostart” means launching v2rayN after you log in to your graphical desktop—not when the machine powers on, before login. For everyday desktop use, prefer an XDG autostart entry. It reuses the executable path maintained by the package, reducing the chance that an upgrade will break it.

XDG desktop autostart

Recommended

Copy the existing desktop entry to your user’s autostart directory. Your desktop environment will launch it when you log in, if it supports XDG autostart.

Best for: Everyday use in GNOME, KDE, and other desktop environments.

Client autostart option

If your version offers an autostart option in Parameter Settings, you can use it—but don’t also create a separate manual entry.

Best for: Users who want to manage startup behavior in the client.

System service

For deployments running the core as a standalone process. You’ll need to manage its configuration, user account, and network dependencies separately; don’t copy the graphical client’s launch command into a service.

Best for: Administrators who need the core running before login and can maintain its configuration independently.

Find the installed desktop file

Run the command below in a regular user terminal. The script copies the file only if it finds exactly one. If it finds multiple files, it lists them and stops. This avoids assuming an install directory or treating the package filename as the launch command.

mapfile -d '' entries < <(
  find /usr/share/applications /usr/local/share/applications \
    -maxdepth 1 -type f -iname '*v2rayn*.desktop' \
    -print0 2>/dev/null
)
if [ "${#entries[@]}" -eq 1 ]; then
  desktop_file="${entries[0]}"
  grep -E '^(Name|Exec|TryExec|Path|Hidden|OnlyShowIn|NotShowIn)=' "$desktop_file"
  autostart_dir="${XDG_CONFIG_HOME:-$HOME/.config}/autostart"
  mkdir -p "$autostart_dir"
  cp -- "$desktop_file" "$autostart_dir/v2rayn.desktop"
  printf 'Copied to: %s\n' "$autostart_dir/v2rayn.desktop"
else
  printf 'Found %s entries; review them manually first:\n' "${#entries[@]}"
  printf '%s\n' "${entries[@]}"
fi

If no entry is found, return to the terminal you used to install the package. Run dpkg-deb -f "$deb_file" Package or rpm -qp --queryformat '%{NAME}\n' "$rpm_file" to get the package name, then use dpkg -L or rpm -ql to list its files. Continue only after confirming the actual desktop entry; don’t guess the program path under /opt.

Check whether autostart is disabled

Open the copied file in a text editor and check the [Desktop Entry] section. If it contains Hidden=true, change it to Hidden=false. If it contains X-GNOME-Autostart-enabled=false, change it to true. You usually don’t need to add these keys if they’re absent. If there’s an OnlyShowIn or NotShowIn entry, make sure it doesn’t exclude your desktop environment.

6. Verify after logging out, and keep a way to undo it

Save your work and exit v2rayN normally, then log out of your desktop and sign back in. Closing the terminal won’t test login autostart. After signing in, check for the window or process, then check the listening port. Some desktops don’t support tray icons, so the icon’s presence—or absence—isn’t a reliable test.

pgrep -af '[vV]2ray[Nn]'
ss -lntp 'sport = :10808'
journalctl --user -b --no-pager -n 100

Whether startup information appears in user logs depends on the desktop environment. No log entry doesn’t necessarily mean startup failed. If the client is running but a node connection times out, wait for the network to come up, then check your subscription, node, and core logs. Don’t add another autostart entry to fix a network problem.

rm -f -- "${XDG_CONFIG_HOME:-$HOME/.config}/autostart/v2rayn.desktop"

7. Common installation and permission errors

The installer says “Permission denied.” Should I change permissions on the whole directory?

First, identify what triggered the error. System packages must be installed by calling the package manager with sudo. If the installer can’t read the package file, check permissions on the file and its parent directories. Never loosen permissions recursively on system directories. If apt says its unprivileged user can’t read a local package but reports that installation succeeded, check the exit status and installation result instead of treating the warning as a launch failure.

The window won’t open. How can I see the actual error?

Check Exec= in the desktop entry, then run the corresponding program from a regular user terminal in your logged-in desktop session. Remove desktop placeholders such as %U and %F, and quote paths correctly. Use the output to determine whether a shared library is missing, the graphical environment is unavailable, or the configuration is invalid. Don’t use sudo to hide the error.

I launched it with sudo before, and now it can’t save settings. What should I do?

Use the error path and ls -ld to check whether the actual configuration directory is owned by root. Exit the app, then change ownership only on the confirmed v2rayN user data directory. Don’t recursively change permissions on your entire home directory, and don’t modify the program installation directory to fix a user configuration write issue.

Autostart stopped working after an upgrade, but launching manually still works. What should I check?

Compare the user autostart file with the newly installed desktop entry, focusing on Exec, TryExec, and Path. An old copy won’t update automatically when the system entry changes. Once you confirm the new entry works, copy it again and verify by logging out and back in.

TUN reports insufficient permissions. Can I just run as root all the time?

First, switch back to a regular local proxy and verify the node connection. Then follow the Linux TUN permission procedure for your version. TUN involves virtual devices and route management; it’s separate from desktop autostart. Running the whole client with elevated privileges just to fix autostart changes configuration ownership and the desktop session environment.

Final verification has three parts: the system package manager can query the package, a proxy request works after launching the client as a regular user, and the listener comes back after you log in to the desktop again. Only when all three pass are installation, connectivity, and autostart complete. Repeat these checks in order after changing ports or upgrading the installation path.

Choose a client and platform

Choose a DEB or RPM package based on your Linux distribution and processor architecture. After installing, verify manual launch and proxy connectivity before returning to this guide to configure login autostart.

Download v2rayNChoose a client for your system