Skip to content

Deployment Guide

John V. Teixido🍉 edited this page Mar 26, 2026 · 2 revisions

Deployment Guide

Deploying RootSpace to production is streamlined via our official multi-stage Docker images. This guide covers the standard deployment architecture for a solitary node or a robust cloud-managed cluster.


🐳 Docker Deployment

The official Dockerfile builds both the Rust Core and the Node Dashboard into a single, cohesive image based on Debian Bookworm.

1. Build the Image

docker build -t rootspace/node:latest .

2. Run the Container

RootSpace requires specific port mappings for the P2P swarm and the REST API.

docker run -d \
  --name rootspace-node \
  -p 8080:8080 \      # Node.js Dashboard & REST API
  -p 4001:4001 \      # libp2p TCP Swarm
  -p 4001:4001/udp \  # libp2p QUIC Swarm
  -v rootspace-data:/data \
  rootspace/node:latest

Note: The -v rootspace-data:/data mount is critical for persisting the SQLite database and the node's cryptographic identity.


🌐 Network Configuration

Port Forwarding

If you are deploying RootSpace on a home network or behind a strict firewall, ensure that port 4001 (TCP/UDP) is forwarded to your machine. Without this, your node will only be able to make outbound connections and cannot act as a full mesh peer.

Environment Variables

Variable Default Description
ROOTSPACE_ENV production Set to development for verbose logging.
API_PORT 8080 The port the Node.js API runs on.
SWARM_PORT 4001 The default libp2p port.
DATA_DIR /data Where SQLite and keypairs are saved.

🛡️ Security Best Practices

  • Do not expose the API port (8080) to the public internet unless it is placed behind a reverse proxy (like Nginx) with SSL/TLS termination and properly authenticated.
  • Keep base images updated: The rust:bookworm base image receives frequent security patches. Rebuild your container regularly.

Clone this wiki locally