Describe the problem/error/question
There’s two different documents explaining how to set up n8n with Docker Compose:
and the setups are very different.
Which one should I follow?
Hey @Daniel, while you wait for a response, here are some things that might help:
Automatically matched to your question.
Docs:
Forum:
@Zelite - you’ve helped with similar issues before, can you take a look?
Automatically suggested by n8n’s community bot. It’s a pilot - please share feedback here.
Hey @Daniel
Both are current, they just solve different problems.
Which to follow depends on what you want. Public server with a domain, take the first. Local machine and you want the AI Assistant, take the second.
Neither includes Postgres by default, both fall back to SQLite. Worth adding for anything beyond testing, the second page has the block for it.
Hi @Daniel
The one-line setup generates the second stack for you, compose.yml, searxng-settings.yml and .env with unique secrets already filled in, so hand-writing those files is only needed if you want to customize the config or fold n8n into an existing Compose project:
curl -fsSL https://get.n8n.io | sh -s -- --version 2.35.0
The version pin stays necessary until 2.35.0 moves from beta to stable.
If you’re going the server route, this covers sizing and provider choice:
What about for people that want both? ![]()
I guess I’ll combine them into one compose.yml file. I’ve already got Nginx running outside the container so I’ll omit Traefik.
I don’t like setup scripts because I don’t trust them to not mess up my existing configuration, and prefer to write my compose.yml by hand so I understand how it’s all set up. I’ll take a look at what the script does, though.
I’ve already got a VPS with 10GB RAM and 100GB NVMe that’s only running Odoo and Swetrix at the moment, so it should be fine. If I have any issues then I’ll move it to one of my 16GB RAM systems ![]()
The combination is already written up. The DigitalOcean and Hetzner guides are a reverse-proxied n8n with the sandbox stack added on top, so you can lift the sandbox services straight from there rather than merging the two Compose files yourself. The proxy only ever routes n8n, the sandbox services stay internal to the Compose network and need no DNS or firewall changes, so dropping Caddy for your external Nginx costs you nothing there. Worth knowing before it goes on the same box as Odoo: sandbox-runner-1 is privileged Docker-in-Docker and is effectively root on the host, and Daytona is the recommended sandbox provider for a real deployment.
The one thing neither page covers for a proxy outside Docker: N8N_HOST plus N8N_PROTOCOL won’t build the right webhook URL, since n8n serves 5678 internally while Nginx answers on 443. Set these on the n8n service and pass X-Forwarded-For, X-Forwarded-Host and X-Forwarded-Proto from Nginx:
N8N_WEBHOOK_URL=https://n8n.example.com/
N8N_PROXY_HOPS=1
N8N_WEBHOOK_URL replaces WEBHOOK_URL, which the Traefik page still uses and which now logs a deprecation warning.
I just saw that the script downlods the compose.yml from https://raw.githubusercontent.com/n8n-io/n8n/master/docker/get-n8n-compose.yml. I can use this as a base and trim it down (or extend it) for my needs. Thanks!
I figured out while evaluating n8n that I need both N8N_WEBHOOK_URL and N8N_EDITOR_BASE_URL, because want to use different URLs for webhooks (publicly accessible) vs the n8n editor itself (only accessible over a VPN).
The latter was hard to figure out since I couldn’t see it in the docs. Maybe I just missed the right page.
Good catch - I didn’t realise this. I’ll stick it on an isolated VM.
So does this mean sysbox or daytona is no longer required?
Previously this was required
Struggling with sysbox on Oracle Linux prior to that
@kjooleng neither is required for the stack the Compose guide builds. It runs sandbox-runner-1 as plain Docker-in-Docker with privileged: true, no sysbox-runc and no Daytona keys, so it comes up on Oracle Linux where sysbox won’t install. The AI Assistant page lists three setups now, the bundled sandbox from the one-line setup, the same stack built by hand, and Daytona, and sysbox is in none of them.
What you lose is what sysbox was there for. The sandbox service repo still expects the runner to run under sysbox-runc, and without it that container is root-equivalent on the host. Daytona stays the recommendation for production and is the one path that avoids both the sysbox install and the privileged container.
Is running the sandbox-runner on a isolated VM a supported deployment technique?It seems valuable from a security perspective, and I don’t want to have a dependency on a third-party service like Daytona. Would I still need to use Docker-in-Docker or can it run directly on the VM?
If you use the one line setup, everything is in place
I don’t want to run the sandbox on the same system as n8n though, since I have other things running on that server and a privileged container on the same system is scary ![]()
@Daniel Then if you have another system, u can run it on there and link it to the first one! Same system would be easier, but if you security harden the sandbox, you should be fine! I myself run a lot of my projects on one single server, claude agents, hermes agents, n8n, searxng, I have a bunch of stuff installed and running, but I’ve never had any issues!
I think that’s fine if you’re already running AI stuff on the same server, since there’s probably no additional risk running the n8n sandbox than the risk that’s already present by running Hermes Agent. In my case, it’s a production server for a business, so running a privileged container is a no-go.
It looks like it shouldn’t be difficult to run sandbox-api and sandbox-runner-1 in Docker on an isolated VM. Essentially I’d just split the compose.yml into two.
The documentation is confusing though, and seems to be outdated. The set up AI assistant docs say to use N8N_INSTANCE_AI_SANDBOX_API_URL to specify the sandbox-api URL, but I don’t see this used anywhere in the code. It seems to be called N8N_SANDBOX_SERVICE_URL now.
I’ll try out using a separate VM when I get time, using the code as reference rather than the docs. I also want to try and get Docker in Docker running rootless (i.e. both the outer and inner Dockers run in rootless mode). I can take a pass at updating the docs once I get things working, unless someone is already planning to update them.
This should be the latest update. Remember, things in Preview will be fluid. Expect changes on the go
Thanks - that announcement post didn’t exist when I was doing my research earlier in the week. I’ll take a look!