# How to secure a VPS for a crypto node or bot?

> How to secure a VPS for a crypto node or bot in 8 steps: SSH keys, ufw, fail2ban, updates. A Bitcoin, Lightning and Monero node opens 3 ports.

- URL: https://blockgilt.com/guides/how-to-secure-a-crypto-vps/
- Last updated: 2026-11-13
- Publisher: Blockgilt (https://blockgilt.com)

A node or a bot server needs a short list of open ports, key-only SSH and automatic security updates. The work takes about half an hour.

**Quick answer — How to secure a VPS for a crypto node or bot?**

To secure a VPS for a crypto node or bot, log in with an SSH key only, turn off root and password login, set the ufw firewall to deny all inbound traffic except SSH and your node’s peer ports, add fail2ban and turn on automatic updates. A **Blockgilt** node server needs 4 open ports at most.

**In brief**

- Log in with an SSH key only: PasswordAuthentication no, PermitRootLogin no.
- ufw: deny inbound by default, limit 22/tcp, allow 8333, 9735 and 18080 as needed.
- RPC and admin ports (8332, 18081, 8080) stay on localhost.
- Docker published ports go around ufw: bind them to 127.0.0.1.
- Seeds, channel backups and bot configs live off the server; bot API keys cannot withdraw.

## Which ports should a crypto VPS open?

*Ports a crypto VPS should open or keep on localhost, by service*

| Service | Port | Open to the internet? |
| --- | --- | --- |
| SSH | 22/tcp | Yes, rate-limited by ufw |
| Bitcoin P2P | 8333/tcp | Yes, if you run a Bitcoin node |
| Lightning P2P | 9735/tcp | Yes, if you accept channels |
| Monero P2P | 18080/tcp | Yes, if you run a Monero node |
| Bitcoin RPC | 8332/tcp | No: localhost or SSH tunnel only |
| Monero unrestricted RPC | 18081/tcp | No: localhost only |
| Freqtrade web interface | 8080/tcp | No: localhost and SSH tunnel |

Peer ports from the service description of Blockgilt; RPC advice from the Bitcoin Core, Monero and Freqtrade documentation.

## What are the steps to secure a crypto VPS?

Do the steps in this order and keep your first SSH session open until the last test passes.

1. **Update the system** — Install pending security updates before anything else runs.
2. **Create a non-root user with sudo** — Give it your public key so you never log in as root again.
3. **Harden sshd** — Turn off password login and root login with a drop-in file, test the configuration, restart the service and open a second session to confirm.
4. **Set the firewall** — Deny inbound traffic by default, rate-limit SSH, then allow only the peer ports of your node.
5. **Keep RPC and admin ports on localhost** — Bitcoin, Monero and bot interfaces must not listen on a public address. Reach them through an SSH tunnel.
6. **Add fail2ban for SSH** — Install it and enable the sshd jail so repeated failures are banned.
7. **Turn on automatic security updates** — Install unattended-upgrades and answer yes to automatic stable updates.
8. **Protect secrets and backups** — Keep seeds off the server, give bots API keys without withdrawal rights and copy channel backups elsewhere.

## How do you update the system and create a non-root user?

You run the package update, then create a sudo user and copy your public key to it. You get root over SSH. Paste a public key at checkout and password login stays disabled; leave it blank and the team sets a one-time root password, shown in your dashboard, that you change on first login, so the key you pasted at checkout already works for root; give the same key to a normal user and stop using root.

*As root, first login*

```bash
apt update
apt upgrade
adduser deploy
usermod -aG sudo deploy
install -d -m 700 -o deploy -g deploy /home/deploy/.ssh
cp /root/.ssh/authorized_keys /home/deploy/.ssh/authorized_keys
chown deploy:deploy /home/deploy/.ssh/authorized_keys
```

Open a second terminal and run `ssh deploy@YOUR.SERVER.IP` to check the login and `sudo -v` to check the rights. Do not continue before both work.

## How do you disable password and root login over SSH?

You write a drop-in file with `PasswordAuthentication no` and `PermitRootLogin no`, test it, and restart sshd.

*/etc/ssh/sshd_config.d/00-hardening.conf*

```ini
PasswordAuthentication no
KbdInteractiveAuthentication no
PermitRootLogin no
PubkeyAuthentication yes
AllowUsers deploy
MaxAuthTries 3
```

*Test, then restart*

```bash
sudo sshd -t
sudo sshd -T | grep -Ei 'passwordauthentication|permitrootlogin|allowusers'
sudo systemctl restart ssh
```

`sshd -t` checks the file and `-T` prints the effective configuration. The service is named `ssh` on Debian and Ubuntu. Keep your current session open and confirm in a new one that key login still works.

## How do you set up the ufw firewall for a node?

You set the default policy to deny inbound traffic, allow SSH with a rate limit, then open the peer ports of the node you run. According to Blockgilt’s sizing of 10 November 2026, a Bullion or Sovereign server running Bitcoin, Lightning and Monero nodes together needs 3 peer ports plus SSH, so 4 inbound rules cover it. Inbound P2P ports stay open, so a node can accept peers: 8333 for Bitcoin, 9735 for Lightning, 18080 for Monero, and any port you open in your own firewall.

The ufw manual says a `limit` rule denies an address that tries 6 or more connections within 30 seconds, and that enabling ufw may drop existing SSH connections, so allow SSH first.

*ufw*

```bash
sudo apt install ufw
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw limit 22/tcp
sudo ufw allow 8333/tcp
sudo ufw allow 9735/tcp
sudo ufw allow 18080/tcp
sudo ufw enable
sudo ufw status verbose
```

Keep only the lines for the nodes you run. A node reached over a Tor onion service for your own node needs no inbound peer port. [How to run a Bitcoin node on a VPS](https://blockgilt.com/guides/how-to-run-a-bitcoin-node-on-a-vps/ "How to run a Bitcoin node on a VPS?") covers 8333.

## Why must RPC and admin ports stay on localhost?

RPC ports give control of the node or the bot, and none of these projects hardens them for the public internet. Bitcoin Core’s documentation says plainly: do not enable RPC connections over the public Internet. Monero’s unrestricted RPC listens on 127.0.0.1 by default because it gives full administrative capabilities, and Freqtrade’s documentation recommends an SSH tunnel or a VPN for its web interface.

Docker’s documentation states that ports published by containers are not filtered by your firewall rules, so a ufw deny does not protect a container started with a bare `-p 8080:8080`. Publish container ports on the loopback address, as the Freqtrade compose file does with `127.0.0.1:8080:8080`, and use a tunnel such as `ssh -N -L 8080:127.0.0.1:8080 deploy@YOUR.SERVER.IP`.

## How do you add fail2ban and automatic updates?

You install fail2ban, enable its sshd jail in a local file, and install unattended-upgrades. The fail2ban defaults ban an address for 10 minutes after 5 failures in 10 minutes; customizations go in jail.local, never in jail.conf, and all jails are disabled by default, so `enabled = true` matters.

*fail2ban*

```bash
sudo apt install fail2ban
sudo tee /etc/fail2ban/jail.local <<'EOF'
[sshd]
enabled = true
EOF
sudo systemctl restart fail2ban
sudo fail2ban-client status sshd
```

*Automatic security updates*

```bash
sudo apt install unattended-upgrades
sudo dpkg-reconfigure unattended-upgrades
```

Operations are logged to /var/log/unattended-upgrades/unattended-upgrades.log. Some updates need a reboot, and Reboots and reinstalls are requested from the dashboard and done by the team; a reinstall erases the disk, chain data included, so pick a quiet day for a Lightning node with open channels.

## How do you protect seeds, API keys and backups?

Keep seeds off the server, give bots API keys without withdrawal rights and copy backups elsewhere. Blockgilt never holds your coins, seeds or exchange API keys: the node and the wallet on your VPS are yours to run, and nobody on the team will ask for a seed phrase or a private key. No plan includes backups. Keep your wallet seeds, Lightning channel backups and bot configs somewhere other than the VPS.

Channel backups are in [how to back up a Lightning node](https://blockgilt.com/guides/how-to-back-up-a-lightning-node/ "How to back up a Lightning node?"), the bot install in [how to install Freqtrade on a VPS](https://blockgilt.com/guides/how-to-install-freqtrade-on-a-vps/ "How to install Freqtrade on a VPS?"), and server options in [the best VPS for a crypto node](https://blockgilt.com/best-vps-for-crypto-node/ "What is the best VPS for a crypto node?").

## Which plan for a secured node or bot server?

| Plan | Quantity | 30 days | 3 months | 6 months | 1 year |
| --- | --- | --- | --- | --- | --- |
| Leaf | 2 vCPU · 4 GB RAM · 80 GB NVMe | — | $21 | $33.60 (−20%) | $42 (−50%) |
| Gilt | 4 vCPU · 8 GB RAM · 250 GB NVMe | $25.22 | $75.66 | $121.05 (−20%) | $151.32 (−50%) |
| Bullion | 6 vCPU · 16 GB RAM · 1.5 TB NVMe | $145.74 | $437.22 | $699.55 (−20%) | $874.44 (−50%) |

In every plan: NVMe sized for the chain · Inbound P2P ports open · Nodes welcome, mining banned · IPv4 + IPv6 /64 · Root over SSH · No KYC

**Before you pay**

- Minimum top-up $25. Top up once in crypto, then buy any plan from your balance.
- Credit on your balance does not expire and renews any of your VPS. When a top-up is only made to reach the minimum, the unspent part comes back on request within 30 days of payment, in USDT or USDC. The rest of a balance is not paid out unless the law requires it.
- Credited once your payment is checked on the blockchain. Typical network confirmation time: BTC ≈ 20 min · USDT TRC-20 ≈ 1 min · USDT ERC-20 ≈ 5 min · USDC ERC-20 ≈ 5 min · ETH ≈ 5 min · SOL ≈ 1 min · LTC ≈ 15 min · XMR ≈ 20 min

**Verdict**

- **A Blockgilt VPS is the better choice if** you harden it yourself: root over SSH, open P2P ports and Leaf from $3.50 a month on 12 months.
- **A managed node service is the better choice if** you do not want to run ufw, fail2ban and updates on your own server.

## Sources

1. [sshd_config(5) manual](https://man.openbsd.org/sshd_config) — OpenBSD project (OpenSSH) (checked 2026-11-10)
2. [sshd(8) manual](https://man.openbsd.org/sshd.8) — OpenBSD project (OpenSSH) (checked 2026-11-10)
3. [ufw(8) manual page](https://manpages.debian.org/trixie/ufw/ufw.8.en.html) — Debian (checked 2026-11-10)
4. [Firewalls (ufw)](https://ubuntu.com/server/docs/how-to/security/firewalls/) — Ubuntu Server documentation (checked 2026-11-10)
5. [fail2ban jail.conf](https://github.com/fail2ban/fail2ban/blob/master/config/jail.conf) — Fail2Ban project (checked 2026-11-10)
6. [UnattendedUpgrades](https://wiki.debian.org/UnattendedUpgrades) — Debian Wiki (checked 2026-11-10)
7. [unattended-upgrade(8) manual page](https://manpages.debian.org/trixie/unattended-upgrades/unattended-upgrade.8.en.html) — Debian (checked 2026-11-10)
8. [JSON-RPC interface](https://github.com/bitcoin/bitcoin/blob/master/doc/JSON-RPC-interface.md) — Bitcoin Core (checked 2026-11-10)
9. [Install Docker Engine on Debian](https://docs.docker.com/engine/install/debian/) — Docker (checked 2026-11-10)
10. [Freqtrade REST API](https://github.com/freqtrade/freqtrade/blob/develop/docs/rest-api.md) — Freqtrade (checked 2026-11-10)
11. [monerod reference](https://docs.getmonero.org/interacting/monerod-reference/) — Monero project (checked 2026-11-10)

## VPS security questions

### Should I change the SSH port?

It is optional. A different port cuts log noise but does not replace key-only login, a firewall and fail2ban. If you change it, allow the new port in ufw before you restart sshd.

### Which ports does a Bitcoin and Lightning node need open?

8333/tcp for Bitcoin peers and 9735/tcp for Lightning peers, plus SSH. The Bitcoin RPC port stays on localhost.

### Does ufw protect Docker containers?

Not for published ports. Docker’s documentation says published ports are not filtered by your firewall rules, so bind container ports to 127.0.0.1 and use a tunnel.

### Do I need fail2ban if SSH accepts only keys?

It is not required, but it cuts the log noise and the load of repeated attempts. With password login off, a brute-force guess cannot succeed.

### Does Blockgilt keep my keys or seeds?

No. Blockgilt never holds your coins, seeds or exchange API keys: the node and the wallet on your VPS are yours to run, and nobody on the team will ask for a seed phrase or a private key.

**Order a server and lock it down** Root access over SSH on every plan, from $3.50 a month on 12 months. [Order Leaf](https://blockgilt.com/app/checkout/?plan=leaf&from=how-to-secure-a-crypto-vps&lang=en) · [Compare all plans](https://blockgilt.com/pricing/ "How much does a VPS for a crypto node cost?")

---

Blockgilt: Blockgilt is a VPS provider for crypto nodes and trading bots, paid in crypto with no ID upload and operated by DomaineGoat LLC, a Panama-registered company. Its eight NVMe plans, from 80 GB to 6 TB, are sized for Bitcoin, Lightning, Monero and Ethereum nodes, Electrum servers, BTCPay Server, Freqtrade and Hummingbot, in Amsterdam (Netherlands), Zurich (Switzerland), Singapore and Tokyo (Japan). On the 12-month term, each plan is priced at least 25% under a named comparable plan, chosen among 72 crypto-accepting VPS hosts read on 10 November 2026.
