TradeLayer is self-hosted: it runs on a small server you rent, so your broker keys and your trades never leave your control. This guide takes you from zero to a server that runs the app 24/7, with your phone connecting to it privately. Plan for about 10–20 minutes the first time (most of it is the server installing itself).
What you'll end up with: a €4–6/month Linux server running the TradeLayer backend in Docker, reachable only by your own devices over a private Tailscale network — never exposed to the public internet.
We recommend Hetzner Cloud. It's EU-based (data centres in Germany and Finland) — a natural fit for an EU-compliant, privacy-first setup — and it has the best price-for-performance of the major hosts. The smallest shared-vCPU plan is more than enough for TradeLayer.
Hetzner CX22
Recommended
Plenty of headroom for the backend + database. If you want to shave a euro, the ARM CAX11 works just as well.
2 vCPU
4 GB RAM
40 GB SSD
Ubuntu 24.04
EU region (Nuremberg / Helsinki)
Roughly €4–6 / month (Hetzner adjusted prices in mid-2026 — check the live figure on their site). Alternatives: Contabo (cheaper, EU), or DigitalOcean / Vultr if you prefer a provider you already use. Any Ubuntu 22.04/24.04 server with ≥2 GB RAM works.
On Windows without SSH, install the free Windows Terminal or use PuTTY. First login asks you to confirm the fingerprint — type yes.
2Install Docker
TradeLayer ships as Docker containers, so you only need Docker itself. Paste this — it's the official install script:
# install Docker + Composecurl -fsSL https://get.docker.com | sh
# check it worksdocker --version
docker compose version
Both commands should print a version number. That's all Docker needs.
3Install Tailscale (private network)
Tailscale creates a private, encrypted network between your server and your phone, so the app is reachable by you and nobody else — no open ports, no public URL. It's free for personal use.
# on the VPScurl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
It prints a login link — open it and sign in (Google/GitHub/email). Then note the server's Tailscale IP, which looks like 100.x.x.x:
tailscale ip -4
Write that 100.x.x.x address down — you'll need it in step 5 and step 7. Finally, install the Tailscale app on your phone from the App Store / Play Store and sign in with the same account.
Want to reach it from anywhere (5G), the easy way? A Cloudflare Tunnel gives your backend a fixed https://… address that your phone reaches from any network — no VPN app on your phone, no open ports, and the address never changes (so your pairing won't break). It's our recommended route; Tailscale here is the private-only alternative. → Follow the 10-minute Cloudflare Tunnel guide.
4Get TradeLayer onto the server
Put your TradeLayer folder on the server. If it's in a Git repository, clone it:
git clone <your-tradelayer-repo-url> trading-os
cd trading-os
No repo? Copy it up from your own computer with scp (run this on your computer, not the server):
You get your TradeLayer copy when you're accepted into the beta — we'll send you the download or repository access with your welcome email.
5Configure it (.env)
The production stack reads its secrets from a .env file in the project folder. Create one:
nano .env
Paste this and fill in the values. Use long, random strings for the password and secrets:
# --- required ---
POSTGRES_PASSWORD=# a long random password
TRADING_OS_WEBHOOK_SECRET=# a long random string
TRADING_OS_API_TOKEN=# a long random string (also goes in the app)
TS_BIND_IP=100.x.x.x # your Tailscale IP from step 3# --- OKX (optional — you can also add keys later in the app) ---
TRADING_OS_OKX_API_KEY=
TRADING_OS_OKX_API_SECRET=
TRADING_OS_OKX_PASSPHRASE=
TRADING_OS_OKX_DEMO=true
Save with Ctrl+O, Enter, then exit with Ctrl+X. A quick way to generate a random secret:
openssl rand -hex 24
POSTGRES_PASSWORD
Password for the app's own database (internal only).
TRADING_OS_WEBHOOK_SECRET
Shared secret for TradingView alerts (only needed if you automate).
TRADING_OS_API_TOKEN
Extra lock on top of Tailscale. Must match API_TOKEN in the app.
TS_BIND_IP
Your server's 100.x.x.x Tailscale address — the backend binds only here.
6Start it
Bring the stack up with the production compose file. The first build takes a couple of minutes:
docker compose -f docker-compose.prod.yml up -d --build
You want to see the backend start cleanly (press Ctrl+C to stop watching the logs — the app keeps running). It restarts automatically after a crash or reboot.
7Connect your phone
With the Tailscale app signed in on your phone (same account as the server), the app can reach the backend at your server's Tailscale IP on port 8000. In the TradeLayer app's settings, set the backend URL to:
http://100.x.x.x:8000
and the API token to the same value you put in TRADING_OS_API_TOKEN. The connection dot turns green once the app can reach your server. That's it — you're live on your own infrastructure.
Options & Interactive Brokers: IBKR needs its Client Portal Gateway, which runs on a desktop PC that's on, not on the VPS. Crypto/forex brokers (OKX and the rest) run fully on the VPS; only IBKR options trading needs your own machine running alongside.
Keeping it running
Update & maintain
Update to a new version (after pulling or re-copying the latest code):
docker compose -f docker-compose.prod.yml up -d --build
Stop everything:
docker compose -f docker-compose.prod.yml down
Backups: your trades live in the Postgres volume on the server. Hetzner's automatic backups (a small add-on) or a periodic snapshot are worth it.
Security: because the backend binds only to the Tailscale IP, it's never on the public internet. Keep your Tailscale account secure and enable 2FA.
Kill switch: nothing is sent to any broker until you enable sending in the app, and the kill switch is always one tap away.
Stuck? Email [email protected] with what step you're on and the last few log lines — we'll help you get it running.