File Synchronization

    Deploy Syncthing on RamNode VPS

    Syncthing is a free, open-source, peer-to-peer file synchronization program. Deploy it on RamNode VPS hosting to create an always-on synchronization hub for all your devices with complete privacy and end-to-end TLS encryption.

    Ubuntu 22.04/24.04
    End-to-End Encryption
    Multi-Device Sync
    ⏱️ 15-20 minutes

    Why Use Syncthing on a VPS?

    Key Benefits:

    • Always-On: VPS runs 24/7, syncing even when devices are offline
    • Central Hub: Acts as relay for all your devices
    • Backup Repository: Complete copy on reliable storage
    • Privacy First: End-to-end TLS encryption

    No Vendor Lock-in:

    • • Open-source with no subscription fees
    • • No storage limitations
    • • Your data never touches third-party servers
    • • Complete control over your files

    Prerequisites

    Before getting started, ensure you have:

    Server Requirements

    • • RamNode VPS with Ubuntu 22.04 or 24.04
    • • Root or sudo access
    • • SSH client for remote access
    • • Domain name (optional, for web GUI)

    Resource Requirements

    ComponentMinimumRecommended
    RAM512 MB1 GB+
    CPU1 vCPU2 vCPU
    Storage1 GB10+ GB SSD
    2

    Installation

    Install Syncthing via the official APT repository for the latest stable releases:

    Step 1: Update System Packages
    sudo apt update && sudo apt upgrade -y
    Step 2: Add the Syncthing Repository
    # Add the release PGP keys
    sudo mkdir -p /etc/apt/keyrings
    sudo curl -L -o /etc/apt/keyrings/syncthing-archive-keyring.gpg \
    https://syncthing.net/release-key.gpg
    
    # Add the stable channel repository
    echo "deb [signed-by=/etc/apt/keyrings/syncthing-archive-keyring.gpg] \
    https://apt.syncthing.net/ syncthing stable" | \
    sudo tee /etc/apt/sources.list.d/syncthing.list
    Step 3: Install Syncthing
    sudo apt update
    sudo apt install syncthing -y
    Step 4: Verify Installation
    syncthing --version

    ✅ You should see output similar to: syncthing v1.27.x

    3

    Creating a Dedicated User

    For security, run Syncthing under a dedicated non-root user account:

    Create Syncthing User and Directory
    # Create the syncthing user
    sudo useradd -m -s /bin/bash syncthing
    
    # Create the sync directory
    sudo mkdir -p /home/syncthing/Sync
    sudo chown -R syncthing:syncthing /home/syncthing

    💡 Security: Running services as non-root users limits potential damage from security vulnerabilities.

    4

    Systemd Service Configuration

    Configure Syncthing to run as a systemd service for automatic startup:

    Enable and Start Service
    # Enable the service to start on boot
    sudo systemctl enable syncthing@syncthing.service
    
    # Start the service
    sudo systemctl start syncthing@syncthing.service
    
    # Check status
    sudo systemctl status syncthing@syncthing.service

    Service Management Commands

    CommandDescription
    systemctl start syncthing@syncthingStart the service
    systemctl stop syncthing@syncthingStop the service
    systemctl restart syncthing@syncthingRestart the service
    journalctl -u syncthing@syncthing -fView live logs
    5

    Configuring Remote Access

    By default, Syncthing's web GUI only listens on localhost (127.0.0.1:8384). To access it remotely:

    Option 1: SSH Tunnel (Recommended)

    The most secure method is to use an SSH tunnel from your local machine:

    Create SSH Tunnel
    ssh -L 8384:127.0.0.1:8384 user@your-vps-ip

    Then access the GUI at: http://127.0.0.1:8384

    6

    Security Configuration

    Set GUI Authentication

    Always enable password authentication for the web GUI. Access the interface and navigate to Actions → Settings → GUI. Configure a strong username and password.

    Configure Firewall Rules

    Configure UFW Firewall
    # Enable UFW if not already active
    sudo ufw enable
    
    # Allow SSH (important!)
    sudo ufw allow 22/tcp
    
    # Allow Syncthing sync protocol
    sudo ufw allow 22000/tcp
    sudo ufw allow 22000/udp
    
    # Allow local discovery (optional)
    sudo ufw allow 21027/udp
    
    # Allow GUI access (only if not using SSH tunnel)
    sudo ufw allow 8384/tcp
    
    # Verify rules
    sudo ufw status verbose

    Port Reference

    PortProtocolPurpose
    8384TCPWeb GUI (HTTPS)
    22000TCP/UDPSync Protocol
    21027UDPLocal Discovery
    7

    Reverse Proxy with Nginx (Optional)

    For production environments, use Nginx as a reverse proxy with Let's Encrypt SSL:

    Install Nginx and Certbot
    sudo apt install nginx certbot python3-certbot-nginx -y
    Create Nginx Configuration
    sudo nano /etc/nginx/sites-available/syncthing

    Add the following configuration:

    Nginx Configuration
    server {
        listen 80;
        server_name sync.yourdomain.com;
    
        location / {
            proxy_pass http://127.0.0.1:8384;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_read_timeout 600s;
            proxy_send_timeout 600s;
        }
    }
    Enable Site and Obtain SSL
    sudo ln -s /etc/nginx/sites-available/syncthing /etc/nginx/sites-enabled/
    sudo nginx -t
    sudo systemctl reload nginx
    
    # Obtain SSL certificate
    sudo certbot --nginx -d sync.yourdomain.com
    8

    Adding Devices and Folders

    Finding Your Device ID

    Each Syncthing installation has a unique Device ID:

    1. Access the web GUI at https://your-server:8384 (or via SSH tunnel)
    2. Click Actions → Show ID
    3. The Device ID is displayed as a QR code and alphanumeric string
    Get Device ID via CLI
    sudo -u syncthing syncthing --device-id

    Adding a Remote Device

    1. In the web GUI, click "Add Remote Device"
    2. Enter the Device ID from your other computer/device
    3. Give it a friendly name (e.g., "Work Laptop")
    4. Click Save
    5. On the remote device, accept the connection request

    Creating a Shared Folder

    1. Click "Add Folder" in the web GUI
    2. Set a Folder Label (display name) and Folder ID (unique identifier)
    3. Set the Folder Path (e.g., /home/syncthing/Sync/Documents)
    4. Under "Sharing", select which devices should sync this folder
    5. Configure versioning and other options as needed
    9

    Advanced Configuration

    10

    Troubleshooting

    Viewing Logs

    View Logs
    # System logs
    sudo journalctl -u syncthing@syncthing -f
    
    # Syncthing's own log file
    tail -f /home/syncthing/.local/state/syncthing/syncthing.log

    Best Practices

    • Enable versioning: Use at least "Trash Can" versioning to recover from accidental deletions
    • Use SSH tunnels: Prefer SSH tunnels over exposing the GUI publicly
    • Strong authentication: Set a strong GUI password and consider disabling the API
    • Regular backups: Syncing is not a backup; maintain separate backup procedures
    • Monitor disk space: Set up alerts for low disk space on your VPS
    • Keep updated: Regularly update via apt to get security patches
    • Use introducer devices: Configure your VPS as an introducer to simplify adding new devices

    Congratulations!

    You now have a fully functional Syncthing instance running on your RamNode VPS. This setup provides you with a private, secure, and always-available file synchronization hub that you fully control.

    Key Takeaways:

    • • Your data never touches third-party servers
    • • All connections are encrypted with TLS
    • • Complete control over which devices can access your files
    • • VPS acts as a reliable always-on node for continuous sync