How to Deploy sing-box on a LightNode VPS
sing-box is a configurable networking platform with JSON-based settings for inbound connections, outbound connections, DNS, routing, endpoints, and services. It is intended for users who already understand the protocol and routing design they plan to run.
LightNode provides sing-box as an application image. The image prepares the application environment, while you remain responsible for the active configuration, allowed traffic, credentials, certificates, firewall, and updates.
Create a sing-box VPS on LightNode
Create the VPS
- Open the sing-box VPS page.
- Choose the sing-box image in the LightNode application catalog.
- Select a location near the endpoints that will use the server.
- Choose a plan based on expected traffic, then create the VPS.
- Save the public IP and SSH credentials.
Hourly billing lets you check latency and reachability before keeping a location for longer-term use.
Connect and identify the installed service
ssh root@YOUR_SERVER_IP
Check the installed version and service status:
sing-box version
sudo systemctl status sing-box --no-pager
Read the service unit before editing configuration:
sudo systemctl cat sing-box
Look at the ExecStart line to confirm the configuration file or configuration directory used by the image. Do not assume that a path from another distribution or tutorial matches the running service.
Back up the active configuration
After confirming the real configuration path, create a dated backup. If the service uses /etc/sing-box/config.json, the command is:
sudo cp /etc/sing-box/config.json /etc/sing-box/config.json.backup-$(date +%F-%H%M%S)
Keep credentials and private keys out of public repositories and shared screenshots.
Edit only the fields you need
sing-box uses JSON. Its current top-level configuration can include logging, DNS, endpoints, inbounds, outbounds, routing, services, and experimental features.
Use the official sing-box configuration reference for the version installed on the VPS. Protocol fields change over time, so a copied configuration can fail even when its JSON syntax is valid.
Edit the active file with your preferred editor:
sudo nano /etc/sing-box/config.json
Replace the example path when the systemd unit uses a different file.
Validate before restarting
Run the configuration check against the active file:
sudo sing-box check -c /etc/sing-box/config.json
If the systemd unit loads a configuration directory, pass the same directory or arguments shown in ExecStart. Fix every reported error before restarting the service.
Then restart and inspect the result:
sudo systemctl restart sing-box
sudo systemctl status sing-box --no-pager
sudo journalctl -u sing-box --output cat -e
The official package manager guide documents the systemd service commands used by current package installations.
Open only required ports
Match LightNode firewall rules and the VPS firewall to the inbounds in your verified configuration. Do not expose a management port or an unused inbound to the public internet.
Before allowing production traffic, test each required port from an authorized client and check the sing-box logs. Confirm DNS behavior and routing separately because a running service can still have an incorrect route or resolver configuration.
Roll back a failed change
If a new configuration fails, restore the backup and restart the service:
sudo cp /etc/sing-box/config.json.backup-TIMESTAMP /etc/sing-box/config.json
sudo sing-box check -c /etc/sing-box/config.json
sudo systemctl restart sing-box
Keep an SSH session open while changing the service and firewall. The LightNode console provides a second recovery path if the network configuration blocks normal access.
Maintenance checklist
- Record the installed sing-box version before changing configuration.
- Back up the active file before every material change.
- Run
sing-box checkbefore restarting. - Inspect systemd status and logs after restarting.
- Keep credentials and private keys outside source control.
- Review open ports when adding or removing inbounds.
LightNode provides the VPS and application image. The network policy and sing-box configuration remain under your control.
