
n8n is installed on a VPS with Docker Compose: one file describes the container, one command starts it, and the interface appears on port 5678. This article shows what the file needs and why. The details that change between versions are in the official n8n documentation, which you should check for the current version.
| n8n is third-party software. Installing and maintaining it is your side, on an unmanaged VPS. We do not sell n8n and our support does not install or repair it. See how far our support goes. |
Before you start
|
|
|
What the compose file needs
In a folder of its own (for example /opt/n8n) create a compose.yaml file with a single service. These are the points that matter:
| Field | What to put | Why |
| image | The official n8n image, with a pinned version. | A pinned version prevents surprise jumps. The exact image name and versions are in the official documentation. |
| ports | 127.0.0.1:5678:5678 |
The interface is reachable only from the server itself. The HTTPS proxy gets in, not the internet. |
| environment | N8N_ENCRYPTION_KEY, WEBHOOK_URL, GENERIC_TIMEZONE |
The key protects the credentials; the public address tells n8n which URL to show for webhooks; the time zone puts schedules at the right hour. |
| volumes | A persistent volume mounted on the n8n data folder. | Without it, workflows and credentials vanish when the container is recreated. |
| restart | Restart always, unless stopped by hand. | n8n comes back by itself after the server reboots. |
Start it and check
|
|
|
|
| Do not lose or change the encryption key. With a different key n8n can no longer read the stored credentials. And do not expose port 5678 straight to the internet without HTTPS: the owner login and the credentials would travel in the clear. See ports and firewall on a VPS. |
| Back up the compose folder from day one, with the data volume. See backing up n8n. |
|
The VPS does not answer, or the address does not reach the machine? Open a ticket and we will check the server. Open a support ticket |
|
SEE ALSO n8n behind HTTPS on your own domain |
RECOMMENDED PRODUCT VPS server with root access Resources of your own, the OS you choose, reinstall whenever you like. from $8.39/mo (3-year plan, with coupon) See plans |
- 0 Users Found This Useful











