Before you start
Install Docker
Skip this if docker --version already prints a version.
On Ubuntu or Debian, Docker's install script adds its repository and installs Docker Engine. Other distributions are covered in Docker's install docs.
sudo apt update
sudo apt install -y ca-certificates curl
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USERSign out and back in, then confirm:
docker --version
docker compose versiondocker --versionprints a versiondocker compose versionworksdocker psruns without an error
Write the compose file
One short file describes the node: which image, which ports, where the data lives.
mkdir -p ~/kaspad-docker
cd ~/kaspad-dockerSave this in that folder as docker-compose.yml:
services:
kaspad:
image: kaspanet/rusty-kaspad:latest
container_name: kaspad
restart: unless-stopped
ports:
- "16111:16111" # P2P, needed for a public node
- "127.0.0.1:16110:16110" # RPC, from this machine only
volumes:
- kaspad-data:/app/data
command:
- kaspad
- --yes
- --nologfiles
- --disable-upnp
- --utxoindex
- --rpclisten=0.0.0.0:16110
logging:
options:
max-size: "50m"
max-file: "3"
volumes:
kaspad-data:- restart
- Brings the node back after a crash or a reboot
- ports
- 16111 for other nodes; 16110 for RPC, from this machine only
- volumes
- Chain data that outlives the container
- command
- Runs kaspad with the index wallets need
- logging
- Keeps the log to 150 MB
Know where the data lives
The chain is stored in a Docker volume, separate from the container, so upgrades never touch it.
docker volume ls
docker volume inspect kaspad-docker_kaspad-dataDon't delete the volume. Removing kaspad-data throws away the whole chain and the node has to sync again from nothing.
Start the node
The first run downloads the image and creates the volume.
cd ~/kaspad-docker
docker compose up -d
docker compose psdocker compose psshows kaspad as Up- Ports 16110 and 16111 are listed
Check it is syncing
The first sync takes one to two hours on a machine that meets the requirements, longer on slower ones. Follow the log; press Ctrl+C to stop following.
docker compose logs -f kaspad- Peers connect, 8 or more
- Headers and blocks are being downloaded
- No error repeats in the log
Make it public
Optional, and the most useful thing you can do: a public node helps new nodes join and sync.
- Find the local address of the machine running Docker.
- Open your router's admin page, usually at 192.168.1.1.
- Forward external TCP port 16111 to that machine, port 16111.
The container doesn't ask the router to open the port, so forward it by hand. On a Linux host with a firewall, open the port there too:
sudo ufw allow 16111/tcpRouter menus differ. portforward.com has steps for most models.
- The log shows inbound peers
- The peer count climbs past 20
- It appears on KasNodes after the next crawl
Day-to-day commands
Everything you'll need once it is running.
- Stop
docker compose stop- Start
docker compose start- Restart
docker compose restart- Update to the newest version
docker compose pull docker compose up -d- Which version is running
docker compose exec kaspad printenv RUSTY_VERSION- Resource use
docker stats kaspad
Troubleshooting
The usual problems and what fixes them.
The container keeps restarting
Read the last lines of the log with docker compose logs --tail=100 kaspad. Most often the disk is full or the machine has run out of memory. On Docker Desktop, check the memory and disk limits in Settings, Resources.
No peers connect
Check that the machine has a working connection and that nothing blocks outbound traffic. Give it a few minutes after starting.
Updating didn't change the version
docker compose pull fetches the newest image, and docker compose up -d restarts kaspad on it. Network upgrades need a new version, so update when Kaspa announces one.
It doesn't show as public
Confirm the router forwards TCP 16111 to the right machine and that a host firewall isn't blocking it. Some providers don't allow inbound connections at all.
The disk is filling up
Keep at least 640 GB free for the chain, 1 TB is better. On Docker Desktop, raise the virtual disk limit in Settings, Resources.
Running? Put your name on it.
Once the node shows up in a crawl you can claim it, pick a public name and follow its rank.