The Debian family covers most Linux desktop users. This walks through it in the order you actually do things, including the step most guides omit: making the rest of the system use the proxy.
Install
cd ~/Downloads
# the leading ./ is required, or apt looks for a repo package of that name
sudo apt install ./v2rayN-linux-64.deb
# if dependencies are missing
sudo apt update
sudo apt install -fLaunching
v2rayN
# if the command is not found, locate it
which v2rayN || dpkg -L v2rayn | grep binMaking the system actually use it
This is where people get stuck. Unlike Windows there is no single "system proxy" — different layers need configuring separately.
Desktop: in GNOME, Settings → Network → Network Proxy → Manual, with 127.0.0.1 and port 10809 for both HTTP and HTTPS. In KDE it lives under System Settings → Network → Settings → Proxy.
export http_proxy="http://127.0.0.1:10809"
export https_proxy="http://127.0.0.1:10809"
export all_proxy="socks5://127.0.0.1:10808"
export no_proxy="localhost,127.0.0.1,::1,*.local"
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$https_proxysudo tee /etc/apt/apt.conf.d/95proxy > /dev/null <<'EOF'
Acquire::http::Proxy "http://127.0.0.1:10809";
Acquire::https::Proxy "http://127.0.0.1:10809";
EOF
# remove the file when you no longer want itAutostart
mkdir -p ~/.config/autostart
cat > ~/.config/autostart/v2rayn.desktop <<'EOF'
[Desktop Entry]
Type=Application
Name=v2rayN
Exec=v2rayN
X-GNOME-Autostart-enabled=true
X-GNOME-Autostart-Delay=15
EOFThe 15-second delay lets the network come up first, avoiding the situation where every server test fails at boot because there was no connectivity yet.
Headless servers
v2rayN is a GUI client and will not run on a server without a desktop. The right approach there is to run the core directly:
# 1. configure on a desktop machine, export the generated config.json
# 2. copy the core binary and config.json to the server
# 3. keep it running with systemd
sudo tee /etc/systemd/system/xray.service > /dev/null <<'EOF'
[Unit]
Description=Xray Service
After=network-online.target
[Service]
ExecStart=/usr/local/bin/xray run -c /usr/local/etc/xray/config.json
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable --now xray
sudo systemctl status xrayThe server then has a permanent local proxy port, and everything else uses it through the same environment variables.