Self-host n8n on a Cube
Run n8n on a Krova Cube — the open-source workflow automation platform with native AI agent nodes and 1,500+ chat-app and SaaS integrations.
n8n is the open-source workflow automation platform with first-class AI agent nodes and 1,500+ integrations. It is the right pick when what you actually want is a workflow that triggers from a chat-app message, calls an AI, and posts the result back — rather than a single chat companion. n8n is fair-code (Sustainable Use License) and self-hosts cleanly on a Cube.
The install is one Docker Compose command. The part worth reading carefully is Step 5 — the n8n web UI runs on port 5678, and a Cube has no public inbound of its own. The path is to point a domain at the Cube and let the Krova edge terminate TLS.
Before you start
n8n runs as a Docker container with an embedded database. The workflow engine is small; the heavy resource is whatever nodes the workflow calls. For an AI agent workflow that calls a hosted LLM, the Cube size is dominated by n8n itself plus the number of concurrent workflow runs you expect.
- A Cube of 2 vCPU, 4 GB RAM, 40 GB disk — about $0.0140/hour, roughly $0.34/day or $10/month if left running. Comfortable for n8n plus the default SQLite database and a small local model.
- If you want to run a capable local model (around 7B parameters) alongside n8n, plan on 8 GB RAM and 8 GB of disk for the model weights. The Cube size for that is 4 vCPU, 16 GB RAM, 100 GB disk.
- An SSH key pair, as with any Cube.
- An API key from an AI provider — or a local Ollama install if you would rather skip the paid API.
Step 1 — Create the Cube
Create a Cube with the Ubuntu 24.04 + Docker image. n8n ships as a Docker image, and starting from the Docker image skips the apt-install step. If your Cube image picker does not have a Docker image, plain Ubuntu 24.04 works — n8n's installer pulls Docker in.
Size it at 2 vCPU / 4 GB / 40 GB for a typical n8n install, or 4 vCPU / 16 GB / 100 GB if you also want to run a local 7B model through Ollama on the same Cube.
Step 2 — Connect over SSH
ssh ubuntu@<cube-host> -p <port>Step 3 — Run n8n in Docker
n8n publishes a single Docker image and a one-line run command. The canonical Docker install uses the latest tag and persists data in a named volume:
docker volume create n8n_data
docker run -d --name n8n \
-p 5678:5678 \
-v n8n_data:/home/node/.n8n \
-e N8N_HOST=localhost \
-e WEBHOOK_URL=http://localhost:5678/ \
--restart unless-stopped \
docker.n8n.io/n8nio/n8nThe N8N_HOST and WEBHOOK_URL env vars will get updated in Step 5 once you have a real domain. Confirm the container is up:
docker psYou should see the n8n container running on port 5678. Reach it through an SSH tunnel for the first-time setup:
ssh -L 5678:localhost:5678 ubuntu@<cube-host> -p <port>Leave the tunnel open and visit http://localhost:5678. You should see the n8n first-time setup screen — create the owner account before publishing the port to the internet.
Step 4 — Add AI nodes
n8n ships native nodes for OpenAI, Anthropic, Google Gemini, and any OpenAI-compatible endpoint. The AI agent nodes wire a model to tools, memory, and an execution loop, and the LangChain nodes cover the broader ecosystem.
For a local model, install Ollama on the same Cube and point n8n at it. Ollama exposes an OpenAI-compatible API on http://localhost:11434:
curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3.1:8bIn n8n, add an OpenAI node, set the Base URL to http://localhost:11434, and pick the llama3.1:8b model. Everything from there is local.
Step 5 — Give n8n a real address
n8n serves its web UI and webhooks on port 5678. On the Cube's Networking tab, add a domain and map it to port 5678:
- Add a DNS record for your domain pointing at
dns.krova.cloud(the Cube's networking tab has a copy button for it). - On the Cube's Networking tab, choose Add Domain:
- Domain — the hostname, e.g.
n8n.example.com. - Port —
5678, the n8n UI port. - This app serves HTTPS itself — leave it unchecked. n8n serves over plain HTTP internally; Krova adds the TLS.
Once the domain reads Active, the n8n UI is at https://n8n.example.com with no tunnel and no published port. Update the n8n container's environment variables to match:
docker stop n8n
docker rm n8n
docker run -d --name n8n \
-p 5678:5678 \
-v n8n_data:/home/node/.n8n \
-e N8N_HOST=n8n.example.com \
-e WEBHOOK_URL=https://n8n.example.com/ \
-e N8N_PROTOCOL=https \
--restart unless-stopped \
docker.n8n.io/n8nio/n8nRestart n8n with the new env vars so webhooks and the UI point at the right URL.
Step 6 — Wire a chat-app workflow
n8n ships native nodes for Telegram, Discord, Slack, WhatsApp and 1,500+ other services. The typical "personal assistant as a workflow" shape is:
- A trigger node that listens for a message on Telegram or Slack.
- An AI agent node that takes the message as input, calls an LLM with the configured tools and memory, and returns a reply.
- A response node that posts the reply back to the same channel.
The full LangChain nodes (an LLM, a memory buffer, tools) compose inside the AI agent node — the workflow surface is the chat-app glue around it.
What it costs
The 2 vCPU / 4 GB / 40 GB Cube described here bills at about $0.0140/hour — roughly $0.34/day, or $10/month if left running. Usage is metered by the minute.
On top of that, either an AI provider bill (paid per message) or the local Ollama path. Ollama is free to run; the only cost is the larger Cube to fit the model weights in RAM. n8n Cloud offers paid hosted tiers at n8n.io if you ever want to outsource the control plane — the self-hosted build on a Cube is free under the Sustainable Use License.
Cleaning up
Deleting the Cube removes n8n, every workflow definition, the workflow history, and any local model weights along with the disk. If a workflow matters, snapshot the Cube first.
Next steps
- n8n node — the Krova community node for n8n, used to drive Krova from n8n workflows. different take on the same install.
- Custom domains — required if you want the n8n UI at your own address.
- Cubes — sizing, snapshots, and how billing works when a Cube is stopped.
