# How do I run a trading bot on a VPS?

> How to run a trading bot on a VPS with Freqtrade in 7 steps: Docker, a dry-run config, trade-only API keys, the web UI over SSH and logs.

- URL: https://saltvps.com/guides/how-to-run-a-trading-bot-on-a-vps/
- Last updated: 2026-11-16
- Publisher: SaltVPS (https://saltvps.com)

**Quick answer — How do I run a trading bot on a VPS?**

To run a trading bot on a VPS, install Docker, pull the bot (Freqtrade here), create a config in dry-run mode, add exchange API keys without withdrawal rights and start it with docker compose up -d. A **SaltVPS** Flake server (4 GB RAM) keeps it online all day. No setup makes a strategy profitable.

**In brief**

- **Why a VPS**: the bot keeps running when your laptop sleeps or your home connection drops.
- **Example bot**: Freqtrade, free and open source, run in Docker.
- **Start in dry-run**: simulated trades with no real orders until you choose otherwise.
- **API keys**: trading rights only, never withdrawals, and restricted to the server IPv4 where the exchange allows it.
- **Risk**: a bot follows your rules faithfully, losses included.

## How do you run a trading bot on a VPS with Freqtrade?

**Docker must be installed first. These commands follow the Freqtrade Docker quickstart.**

1. **Make a project folder** — Run mkdir ft_userdata and cd ft_userdata.
2. **Get the Compose file** — Run curl https://raw.githubusercontent.com/freqtrade/freqtrade/stable/docker-compose.yml -o docker-compose.yml, then docker compose pull.
3. **Create the user folder** — Run docker compose run --rm freqtrade create-userdir --userdir user_data.
4. **Create a config** — Run docker compose run --rm freqtrade new-config --config user_data/config.json and answer the questions. Keep dry-run on.
5. **Start the bot** — Run docker compose up -d. The container restarts on its own after a reboot.
6. **Watch the logs** — Run docker compose logs -f to follow what the bot does. Press Ctrl+C to stop reading; the bot keeps running.
7. **Open the web UI safely** — FreqUI listens on 127.0.0.1:8080. From your computer, run ssh -L 8080:127.0.0.1:8080 root@your-ip, then open http://127.0.0.1:8080.

## Which settings matter most in a Freqtrade config?

**A handful of keys in config.json decide whether the bot trades for real.**

*Key Freqtrade configuration settings for a first run on a VPS*

| Setting | What it does | Safe first value |
| --- | --- | --- |
| dry_run | Simulates trades with no real orders | true |
| dry_run_wallet | Starting balance for the simulation | A small test amount |
| stake_amount | Amount placed per trade | A fixed small amount |
| max_open_trades | How many trades can be open at once | A low number, such as 3 |
| exchange.key / secret | Exchange API credentials | Empty in dry-run; trade-only keys later |
| api_server.listen_ip_address | Where the web UI listens | Keep 127.0.0.1 behind an SSH tunnel |

## How do you keep exchange API keys safe on a VPS?

**Create keys that can trade but never withdraw, and lock them to the server's address.** Most exchanges let you untick withdrawals and enter allowed IP addresses. Every SaltVPS server has one dedicated IPv4, so that list stays one line long.

- Keep config.json readable by its owner only: `chmod 600 user_data/config.json`.
- Log in with an SSH key, not a password; the [security guide](https://saltvps.com/guides/how-to-secure-a-linux-vps/ "How do I secure a Linux VPS?") lists the other steps.
- Rotate the keys at the exchange if you ever suspect the server was reached by someone else.

## Which VPS is best for a trading bot?

**A single Freqtrade bot is light; backtests and several bots at once want more RAM and CPU.** SaltVPS checked its plan list on 16 November 2026: vCPU counts run from 1 on Grain to 12 on Dome, and the plan list matches Grain to a bot. Flake (1 vCPU / 4 GB / 80 GB, $4.50 a month on 12 months) gives Docker more room.

Pick a city near your exchange's servers if latency matters to your strategy; the six cities share one price. The [trading bot VPS comparison](https://saltvps.com/best-vps-for-trading-bots/ "Which VPS is best for trading bots?") weighs plans and cities, and the [Docker guide](https://saltvps.com/guides/how-to-install-docker-on-a-vps/ "How do I install Docker on a VPS?") comes first if Docker is not installed.

## When should a bot leave dry-run mode?

**Only after the strategy behaves as you expect in backtests and in a long dry run.** Freqtrade's own documentation tells users not to risk money they are afraid to lose. A good backtest is no promise of future results. A bot can lose money fast in a market move it was never tested on.

Check the exchange's terms too. Some exchanges limit access by country, and the server's IP addresses are registered in the country of its city.

## Trading bots on a VPS: questions

### Can I run a trading bot on a VPS 24/7?

Yes. That is the main reason to use one. Docker restarts the container after a reboot, and the server stays up without your computer.

### Is Freqtrade the best bot to run on a VPS?

It is one free, open-source option with good documentation. Hummingbot, OctoBot and Jesse are others; the same Docker approach applies.

### Does SaltVPS allow trading bots?

Yes. Crypto mining is forbidden on SaltVPS servers, but a trading bot is not mining.

### How do I update Freqtrade?

In the project folder, run docker compose pull, then docker compose up -d to restart on the new image.

### Can I control the bot from my phone?

Freqtrade can send alerts and take commands through a Telegram bot you set up in config.json.

**Verdict**

- **Running a trading bot on a VPS takes Docker, a dry-run config and trade-only keys.**
- **Keep the web UI behind an SSH tunnel** and go live only after long testing.

## Sources

1. [Freqtrade with Docker quickstart](https://www.freqtrade.io/en/stable/docker_quickstart/) — Freqtrade (2026-11-16)
2. [Freqtrade configuration](https://www.freqtrade.io/en/stable/configuration/) — Freqtrade (2026-11-16)
3. [Freqtrade REST API and FreqUI](https://www.freqtrade.io/en/stable/rest-api/) — Freqtrade (2026-11-16)

**Keep your bot online** Flake runs Docker and a bot comfortably, with a dedicated IPv4 for exchange allow-lists. [Order Flake for 12 months](https://saltvps.com/app/checkout/?plan=flake&term=12m&from=guides-how-to-run-a-trading-bot-on-a-vps&lang=en) · [All guides](https://saltvps.com/guides/ "Which VPS guides and Linux tutorials does SaltVPS publish?")

---

SaltVPS: SaltVPS sells Linux KVM VPS in New York, Dallas, Los Angeles, London, Amsterdam and Frankfurt, paid in crypto with no ID document. Seven plans from 2 to 32 GB of RAM cost the same in all six cities, and on the 12-month term each is priced at least 25% under a named comparable plan of a no-KYC crypto host, read on 16 November 2026. The operator is DomaineGoat LLC, Panama.
