Self-host n8n on Coolify: domain, API and email Automation — A2Z Skills By Ronit Karki, 2026-10-26 https://a2zskillsewa.com/self-host-n8n-coolify/ Short answer: Changing SERVICE_FQDN_N8N on its own did not keep the custom domain across a redeployment in this Coolify 4.5.0 test. Updating the stored service URL and n8n’s own public URL settings resolved that case. The record below also covers the API import and email-node errors seen on n8n 2.10.2. Tested 2026-10-26 on Coolify 4.5.0, n8n 2.10.2, Ubuntu 24.04 arm64, Oracle Always Free VM, 2 OCPU and 12 GB. This recorded setup encountered a domain that reverted on redeployment, an SMTP credential schema mismatch and email-node parameter errors. The commands and outputs below belong to the versions in the test box. More guides are in Automation (/topics/automation/). What this setup covers The test record covers the Coolify and n8n versions listed above, including service deployment, the external hostname and API imports. It describes the SQLite-based service used in that session. No PostgreSQL restore or load-test results are included here. You need access to the Coolify service and control of the hostname you intend to use. Keep the distinction between the service's stored domain and n8n's application settings in mind: changing only one can leave generated links pointing elsewhere. | Symptom | Start with | | ------------------------------------------------------------ | ------------------------------ | | The generated hostname returns after redeployment | The stored service domain | | The editor opens, but generated links still use the old host | The application URL settings | | A workflow imports but refuses to publish | The node's required parameters | The corresponding sections below contain the observations from that test. For a successful run whose destination remains empty, the next question is what the automation actually completed (/automations-failing-silently/). Deploy the service In Coolify, add a new Service, choose n8n, and pick the server and project. In the recorded template, n8n and task-runners became healthy within about a minute. Current Coolify n8n templates (https://coolify.io/docs/services/n8n) have several variants; their container layout and startup time should not be assumed identical. n8n 2.10 logs a deprecation on startup: N8N_RUNNERS_ENABLED is no longer needed. The Coolify template still sets it. Harmless, but do not copy it into anything new. Set the domain, the way that actually works Coolify gives the service a generated hostname like n8n-citjvi7i6byqkriqljgsnlap.apps.example.com. The obvious fix is to change SERVICE_FQDN_N8N, the environment variable that holds it. That does not work. Coolify regenerates the value from the stored domain on every deploy, so your change survives until the next redeploy and then vanishes. The domain is a property of the service, not an environment variable. The API does expose it, under a name that is hard to guess: curl -X PATCH "https://coolify.example.com/api/v1/services/" \ -H "Authorization: Bearer $COOLIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"urls":[{"name":"n8n","url":"https://n8n.example.com"}]}' name is the compose service name, not the Coolify service name. If you get the shape wrong, the validation error tells you what it wants: {"message":"Validation failed.","errors":{"urls.0":[ "An item in the urls array has invalid fields. Only name and url fields are supported."]}} The call above. The response echoes the domain, which is how you know it took. N8N_HOST, WEBHOOK_URL and N8N_EDITOR_BASE_URL. In this test, the application settings also needed the new public hostname. They serve different purposes; verify the URLs generated by the editor after the change. curl -s -o /dev/null -w '%{http_code}\n' https://n8n.example.com/healthz 200 over verified HTTPS confirms that this health request succeeded through the configured endpoint. It does not prove every generated webhook URL or workflow is correct. Create the owner account without the browser The recorded first-run owner setup used the following endpoint. The /rest/ endpoints are internal editor APIs, so their behaviour should not be assumed stable across versions. A password placed directly in a command can also be retained in shell history or exposed through process arguments; the placeholder below is not a safe secret-storage method: curl -X POST "https://n8n.example.com/rest/owner/setup" \ -H "Content-Type: application/json" \ -d '{"email":"you@example.com","firstName":"Your","lastName":"Name","password":""}' Then log in to get a session cookie, and create an API key with POST /rest/api-keys. The key is what the public API at /api/v1/ accepts. Import workflows from files POST /api/v1/workflows takes name, nodes, connections and settings, and rejected the extra fields submitted in this test. Keep your workflow JSON in version control and import it rather than clicking it together twice. Two parameter problems surfaced in the recorded setup. The SMTP credential rejects its own schema. GET /api/v1/credentials/schema/smtp lists disableStartTls as a property. Send it, and the API refuses the whole credential: request.body.data does not match allOf schema [subschema 0] Send only user, password, host, port and secure, and it works. The email node's parameters are not the Gmail node's. emailSend v2.1 wants fromEmail, toEmail and text. If you write sendTo and message, the workflow imports without complaint and then refuses to publish: Cannot publish workflow: 1 node have configuration issues: Node "Email the problems": - Missing or invalid required parameters (2 issues) It names the node and not the fields, which is why this one costs an hour if you do not already know. Three things, none of them documented where we were looking. The domain. We changed SERVICE_FQDN_N8N, redeployed, and the generated hostname came back. We only found the urls field by sending deliberately wrong payloads to the PATCH endpoint and reading the validation errors, which named the accepted fields. Testing the SMTP credential proved nothing. POST /rest/credentials/test returned an empty status and an empty message rather than a pass or a fail. The only way to know the credential worked was to build a one-node workflow with a manual trigger, run it, and read the execution: accepted: [the address], rejected: [] straight from Gmail. A schedule-triggered workflow cannot be run from the public API. There is no endpoint for it. The editor uses POST /rest/workflows/{id}/run with a session cookie, and so can you, passing the full workflow data in the body. Memory, for sizing: n8n and its task runners sat at about 550 MB resident with no workflows running. What this is good for Once it runs, n8n is the glue for everything that is not worth writing a service for: a form that opens a ticket, a schedule that checks a live site and emails only when something is wrong, a weekly report pulled from an API. The same pattern as the Cloudflare Workers custom domain (/cloudflare-workers-custom-domain-not-working/) problem shows up here too: the hosting layer and the application layer each have an opinion about the domain, and they have to be told the same thing twice. If the webhook URL the editor shows you does not answer, the hostname settings above are one of three causes: see n8n webhook not working (/n8n-webhook-not-working/). Once one is running, the thing to plan for is not a crash but a green run that did nothing. That failure mode is covered in why automations fail silently (/automations-failing-silently/). Workflow behaviour after setup n8n item linking (/n8n-item-linking-explained/) explains how expressions select the record associated with each output. Duplicate webhook deliveries (/webhook-retries-duplicate-events/) covers why receiving the same notification again can repeat downstream work. Sources - n8n: public API reference (https://docs.n8n.io/api/api-reference/) - n8n: configuring webhook URLs behind a reverse proxy (https://docs.n8n.io/hosting/configuration/configuration-examples/webhook-url/) - Coolify: service API update reference (https://coolify.io/docs/api-reference/api/operations/update-service-by-uuid) Questions and answers How much memory does n8n use on a small server? Around 550 MB resident for n8n and its task runners in this idle test, with no workflows running. This is an observation for the recorded setup, not a capacity estimate for active workloads or the whole server. Can I import workflows without using the editor? Yes. POST /api/v1/workflows with an API key accepts name, nodes, connections and settings. The recorded request rejected the active flag, so publication was handled separately. Other versions and API fields need their own reference check. Why does my imported workflow refuse to activate? In the recorded case, emailSend v2.1 had incorrect required parameter names. Import succeeded, but publication failed. Other activation failures need their own error evidence; the recorded message does not diagnose every workflow. Does the free Coolify one-click include a database? The recorded setup used SQLite. Coolify also documents PostgreSQL variants. Choosing a database needs workload, backup and recovery requirements; this page includes no PostgreSQL migration or load test.