---
title: "Deploy Syncthing | (Just Updated) Continuous File Synchronization Server, GUI And REST API Locked From Boot"
description: "Syncthing file synchronization server with REST API, web GUI and volume"
category: "Storage"
url: https://railway.com/deploy/syncthing-or-just-updated-continuous-fil
---

# Deploy Syncthing | (Just Updated) Continuous File Synchronization Server, GUI And REST API Locked From Boot

Syncthing file synchronization server with REST API, web GUI and volume

**[Deploy Syncthing | (Just Updated) Continuous File Synchronization Server, GUI And REST API Locked From Boot on Railway](https://railway.com/template/syncthing-or-just-updated-continuous-fil)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/syncthing-or-just-updated-continuous-fil/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** Storage

## Template content

### syncthing

- **Image:** ghcr.io/syncthing/syncthing:2.1.7@sha256:2b71da7c0d0a91a6ae5285ad079226fecc0a365d08b27720e1f7037b018f7546
- **Start command:** `/bin/sh -c 'echo ZXhwb3J0IEhPTUU9L3Zhci9zeW5jdGhpbmcgU1RIT01FRElSPS92YXIvc3luY3RoaW5nL2NvbmZpZyBTVEdVSUFERFJFU1M9Ils6Ol06JHtQT1JUOi04MDgwfSIgU1RHVUlBUElLRVk9IiRTWU5DVEhJTkdfQVBJX0tFWSIKIyB0aGUgdm9sdW1lIGlzIG1vdW50ZWQgb3duZWQgYnkgcm9vdDsgdGhlIGFwcCBydW5zIGFzIDEwMDA6MTAwMApjaG93biAxMDAwOjEwMDAgIiRIT01FIgojIGZpcnN0IGJvb3QgY3JlYXRlcyB0aGUga2V5LCBjZXJ0aWZpY2F0ZSBhbmQgY29uZmlnOyBldmVyeSBib290IChyZSlzZXRzIHRoZSBHVUkgbG9naW4gZnJvbSB0aGUgdmFyaWFibGUKcHJpbnRmICVzICIkU1lOQ1RISU5HX0dVSV9QQVNTV09SRCIgfCBzdS1leGVjIDEwMDA6MTAwMCBlbnYgSE9NRT0iJEhPTUUiIC9iaW4vc3luY3RoaW5nIGdlbmVyYXRlIC0taG9tZT0iJFNUSE9NRURJUiIgLS1ndWktdXNlcj1hZG1pbiAtLWd1aS1wYXNzd29yZD0tCmVjaG8gInN5bmN0aGluZzogZGF0YSBvd25lcj0kKHN0YXQgLWMgJXU6JWcgIiRIT01FIikgZ3VpPSRTVEdVSUFERFJFU1MiCmV4ZWMgL2Jpbi9lbnRyeXBvaW50LnNoIC9iaW4vc3luY3RoaW5n | base64 -d > /tmp/boot.sh; exec sh /tmp/boot.sh'`
- **Health check:** /
- **Public domain:** Yes

## Documentation

# Deploy and Host Syncthing on Railway

**Built for an LLM agent to deploy and use.** The deploy form has nothing to fill in: the web GUI login and the REST API key are generated, the GUI is locked behind a login from the first boot, and the device identity, configuration and synced files survive redeploys on a volume. Syncthing is open-source continuous file synchronization between devices, with a web GUI and a REST API.

## About Hosting Syncthing

This template runs one service from the upstream Syncthing image (version 2.1.7), pinned by digest. Everything Syncthing keeps (device key and certificate, configuration, index database and the default `Sync` folder) lives on one volume mounted at `/var/syncthing`. Railway mounts a volume owned by root while Syncthing runs as an unprivileged user, so the start command fixes the ownership of the volume first.

**No open GUI.** A stock Syncthing starts with no GUI login, which on a public domain would hand the whole instance to the first visitor. The start command sets the GUI login (user `admin`) from the generated `SYNCTHING_GUI_PASSWORD` on every boot, and fixes the REST API key to the generated `SYNCTHING_API_KEY`, so both stay the same across redeploys. There is no account registration in Syncthing: the one login is the one generated for you.

**What the template fixes for Railway.** The web GUI and REST API listen on Railway's injected `PORT`, which is also the port the healthcheck dials.

**Connecting other devices.** The sync listener (port 22000) is not published, because Railway cannot share one service between an HTTP healthcheck and a TCP proxy. This instance reaches your other devices outbound through Syncthing's global discovery and public relays; add the device ID shown in the GUI on the other side. Direct inbound connections to this service are not available.

**Using it.** Open the service domain, sign in as `admin` with `SYNCTHING_GUI_PASSWORD` (read it from the `syncthing` service variables), then add devices and folders. For an agent, use the REST API with the API key as in the contract below.

### Agent contract

- Public URL: `SYNCTHING_PUBLIC_URL` on the `syncthing` service (the generated https address of the service)
- Private URL: `http://syncthing.railway.internal:8080`
- Credentials: the variables `SYNCTHING_API_KEY` (REST API) and `SYNCTHING_GUI_PASSWORD` (web GUI, user `admin`) on the `syncthing` service
- Auth: REST calls send the header `X-API-Key` with the value of `SYNCTHING_API_KEY`; HTTP Basic is not accepted on `/rest`. The web GUI signs in with `POST /rest/noauth/auth/password` and a JSON body holding `username` `admin` and `password` from `SYNCTHING_GUI_PASSWORD`, which answers `204` and sets a session cookie; a wrong login answers `403`. A request with no key or a wrong one answers `403`, so `write without key: 403`.
- Health: `GET /rest/noauth/health` returns 200

```bash
#!/bin/sh
# needs: SYNCTHING_PUBLIC_URL, SYNCTHING_API_KEY, SYNCTHING_GUI_PASSWORD (variables of the syncthing service); also curl
# signup: none - Syncthing has no account registration; the one GUI login is generated at boot, so there is nothing to sign up to
R="$SYNCTHING_PUBLIC_URL"; K="X-API-Key: $SYNCTHING_API_KEY"; J="Content-Type: application/json"
n=0; until [ "$(curl -s -o /dev/null -w '%{http_code}' "$R/rest/noauth/health")" = 200 ]; do n=$((n+1)); [ "$n" -le 60 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/rest/noauth/health"
curl -s -H "$K" "$R/rest/system/status" | grep -c '"myID"' | sed 's/^/status with key (1 = device id returned): /'
# write with the key: add a folder, read it back, remove it
curl -s -o /dev/null -w "create folder: %{http_code}\n" -H "$K" -H "$J" -d '{"id":"railway-check","label":"railway-check","path":"/var/syncthing/railway-check","type":"sendreceive"}' "$R/rest/config/folders"
curl -s -H "$K" "$R/rest/config/folders/railway-check" | grep -c '"id": "railway-check"' | sed 's/^/folder found after write: /'
curl -s -o /dev/null -w "delete folder: %{http_code}\n" -X DELETE -H "$K" "$R/rest/config/folders/railway-check"
# the web GUI login (user admin) answers with a session cookie
curl -s -o /dev/null -w "gui login: %{http_code}\n" -H "$J" -d "{\"username\":\"admin\",\"password\":\"$SYNCTHING_GUI_PASSWORD\"}" "$R/rest/noauth/auth/password"
curl -s -o /dev/null -w "gui login wrong password: %{http_code}\n" -H "$J" -d '{"username":"admin","password":"wrong"}' "$R/rest/noauth/auth/password"
curl -s -o /dev/null -w "read without key: %{http_code}\n" "$R/rest/system/status"
curl -s -o /dev/null -w "write without key: %{http_code}\n" -H "$J" -d '{"id":"anonymous","path":"/tmp/anonymous"}' "$R/rest/config/folders"
curl -s -o /dev/null -w "write wrong key: %{http_code}\n" -H "X-API-Key: wrong" -H "$J" -d '{"id":"anonymous","path":"/tmp/anonymous"}' "$R/rest/config/folders"
```

A fresh deploy prints `health: 200`, `status with key (1 = device id returned): 1`, `create folder: 200`, `folder found after write: 1`, `delete folder: 200` and `gui login: 204`. The refusals print `gui login wrong password: 403`, `read without key: 403`, `write without key: 403` and `write wrong key: 403`: a request with no key or a wrong one creates nothing.

## Why Deploy Syncthing on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Syncthing on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

- **Agent-ready** - generated GUI login and API key, a contract block and one script that proves the REST API, folder create, read and delete, the GUI login, and the refusal of a read and a write with no key or a wrong one.
- **No open GUI** - the login is set at boot, so the first visitor gets nothing.
- **Data survives redeploys** - device identity, configuration and files sit on a volume, with the right ownership set at boot.
- **Always-on peer** - an always-online device other devices can sync through.
- **Pinned** - the upstream image is pinned by digest.

## Common Use Cases

- **Always-on sync hub** - keep one online copy so laptops and phones sync even when they are never on at the same time.
- **Off-site backup target** - mirror a folder from a home machine to a copy kept elsewhere.
- **Self-hosted Dropbox alternative** - sync folders across your devices with no third-party storage.
- **File exchange for AI agents** - an agent drives folders and devices over the REST API.

## Dependencies for Syncthing Hosting

- The one `syncthing` service created by the template with its `/var/syncthing` volume. Nothing else is required.

### Deployment Dependencies

- [Syncthing repository](https://github.com/syncthing/syncthing)
- [Syncthing documentation](https://docs.syncthing.net)
- [Syncthing REST API reference](https://docs.syncthing.net/dev/rest.html)


## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Neo4j 2026.10 Community](https://railway.com/deploy/neo4j-202610-community) — Neo4j graph database with APOC, Browser, Bolt TCP proxy and a volume

Open this page in a browser: https://railway.com/deploy/syncthing-or-just-updated-continuous-fil
