Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › Docker

How to Build Your First n8n Workflow on a Self-Hosted Server

By Freedom251 Team · · 13 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The most reliable beginner setup is a persistent n8n container managed with Docker. Mount a named volume at /home/node/.n8n, open the editor on port 5678, build and test a workflow with a Manual Trigger, then switch to a schedule or public webhook only after the logic works. The volume preserves your workflows, credentials, SQLite data, webhook URL, and encryption key when the container is recreated.

What you will build

This guide takes you from an empty Docker host to a working n8n workflow and explains the decisions that matter when you move beyond local testing. The example starts with a safe, manually started flow:

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Manual Trigger → Edit Fields (Set) → optional HTTP Request

The first two nodes let you learn the editor and data mapping without exposing a service to the internet. You can then replace the manual trigger with a Schedule Trigger, Webhook, or application trigger once the transformation is verified.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

n8n connects applications through their APIs and lets you manipulate data with little or no code. Self-hosting puts the editor, workflow data, credentials, and execution service on infrastructure you control, but it also makes storage, updates, HTTPS, access control, and backups your responsibility.

Choose the right first deployment

Decision Best starting choice When to change it
Where it runs Local Docker installation at http://localhost:5678 Use a VPS or private server for always-on jobs or inbound webhooks.
Container command docker run for a quick experiment Use Docker Compose when you want a repeatable configuration, automatic restarts, or additional services.
Database SQLite, the default for a small single instance Use the documented PostgreSQL deployment pattern when the installation becomes a larger production service.
Trigger Manual Trigger while learning Use Schedule, Webhook, or an application trigger after testing the logic.
Storage A named Docker volume mounted at /home/node/.n8n Never use an ephemeral container for a workflow you need to keep.

Docker is the recommended route for most n8n self-hosting needs. A local instance is easiest to understand, while a remote server is appropriate when an external service must reach your workflow or a job must run while your computer is off.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare the server

Install Docker and Compose

Install Docker Engine and Docker Compose v2 on a headless Linux server. Docker Desktop is suitable for a local learning machine. Confirm both tools are available before creating the n8n container:

docker --version
docker compose version

Run Docker commands as a user permitted to access the Docker socket, or use the appropriate system privileges for your operating system. For the current sandbox-enabled Compose stack, n8n documentation specifies a baseline of at least 4 GB of RAM and 2 vCPUs. Treat that as a planning baseline for that stack rather than a universal requirement: workload size, execution concurrency, binary files, and database choice can require more.

Decide whether the host must be public

  • Local learning: keep the editor on localhost and use Manual Trigger. No public DNS name or inbound firewall rule is needed.
  • Always-on scheduled jobs: use a machine that remains powered on. A private server can run schedules without accepting public webhooks.
  • Inbound webhooks: the server needs a stable, reachable hostname, HTTPS, and a reverse proxy or equivalent network configuration that forwards requests to n8n.

Do not treat localhost as a public callback address. A third-party service cannot deliver a webhook to a loopback address on your own computer.

Start n8n with persistent Docker storage

Quick start with Docker Run

Create the named volume first. It is the part that survives a stopped or recreated container:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
docker volume create n8n_data

Start n8n with the volume mounted at the directory used by the official image:

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
docker run -it --rm 
  --name n8n 
  -p 5678:5678 
  -e GENERIC_TIMEZONE=UTC 
  -e TZ=UTC 
  -e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true 
  -e N8N_RUNNERS_ENABLED=true 
  -v n8n_data:/home/node/.n8n 
  n8nio/n8n
  • -p 5678:5678 maps the host’s port 5678 to the editor inside the container.
  • -v n8n_data:/home/node/.n8n preserves the SQLite database, webhook URL, encryption key, credentials, and workflows.
  • GENERIC_TIMEZONE supplies the timezone used by schedule-oriented nodes.
  • TZ sets the container’s general timezone context, including timestamps produced by the runtime.
  • N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true enables the image’s settings-file permission check.
  • N8N_RUNNERS_ENABLED=true enables task runners in this official example.
  • --rm removes the container object when you stop it; it does not remove the named volume.

Using UTC avoids an ambiguous daylight-saving rule for a first test. For a local schedule, replace both timezone values with the same valid IANA timezone, such as America/New_York or Europe/London, and keep the values consistent.

Leave this command attached to the terminal while learning. Stop it with Ctrl+C, then start the same command again to confirm that the volume restores the instance. Open http://localhost:5678 in a browser when the startup log indicates that n8n is ready.

Repeatable deployment with Docker Compose

Compose is easier to reproduce and extend. Create a project directory and enter it:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
mkdir -p ~/n8n
cd ~/n8n

Create a .env file and keep it out of version control. This simple example uses UTC:

TZ=UTC
GENERIC_TIMEZONE=UTC

Create compose.yml:

services:
  n8n:
    image: n8nio/n8n
    ports:
      - '5678:5678'
    environment:
      - TZ=${TZ}
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
      - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
      - N8N_RUNNERS_ENABLED=true
    volumes:
      - n8n_data:/home/node/.n8n
    restart: unless-stopped

volumes:
  n8n_data:

Start it in the background and check that the container is running:

docker compose up -d
docker compose ps
docker compose logs -f n8n

From the host, the health endpoint provides a quick check that the service responds:

curl -sf http://localhost:5678/healthz

A successful response means the HTTP endpoint answered; it does not replace testing the editor, credentials, triggers, and workflow execution. Keep .env and any files containing secrets out of public repositories.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Complete first-run setup

Open the editor and create the owner account

  1. Browse to http://localhost:5678 on a local installation. On a remote host, use the hostname and HTTPS endpoint you configured.
  2. Complete the first-run owner-account setup before creating credentials or sharing the instance.
  3. Sign in again if the browser asks you to, then confirm that the workflow editor loads and that the node palette is available.

On a public deployment, do not leave the editor exposed through a bare HTTP port. Put it behind HTTPS and restrict who can reach the administrative interface before importing sensitive workflows.

Build a safe first workflow

1. Add a Manual Trigger

Create a new workflow and add Manual Trigger as its first node. This trigger runs only when you click the execution control, so an unfinished workflow cannot be called by an outside service.

2. Add an Edit Fields (Set) node

Connect an Edit Fields (Set) node to the trigger. Add two simple fields, for example:

  • customer_name with the value Alex
  • priority with the value normal

Keep the values non-sensitive. The purpose of this step is to see an item move through the workflow and to learn where each node’s output appears.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Execute and inspect each node

  1. Click Execute Workflow.
  2. Open the Manual Trigger output and confirm that the trigger produced an item.
  3. Open the Edit Fields output and verify that both fields have the expected names and values.
  4. If a node fails, fix it before adding another node. The execution data is more useful than guessing from the canvas.

n8n’s data-mapping interface lets you drag fields from the input pane into later node parameters. You can also create an expression in a parameter; for example, a later field can read the incoming value with {{$json.customer_name}}. In an HTML article, the expression is shown literally; in the n8n editor, enter it as an expression rather than as ordinary fixed text.

4. Add an optional HTTP Request

Only after the first two nodes succeed, add an HTTP Request node. Point it at a harmless public test endpoint or an API you control, then execute the workflow again. Inspect the request result and confirm that the mapped fields are present where you expect them.

If the endpoint requires authentication, create a credential in n8n’s credentials area and select it in the node. Do not paste API keys into expressions, field values, screenshots, or workflow text. Credentials should remain in n8n’s credential store so they can be rotated without editing every node.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Replace the manual trigger only after the logic works

Scheduled workflow

Use Schedule Trigger when the workflow should run at an interval or at a specified time. Before activating it:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Confirm that GENERIC_TIMEZONE is set to the timezone you intend the schedule to use.
  • Confirm that TZ is also set consistently.
  • Run the workflow manually where possible and inspect the output at the scheduled node and every downstream node.
  • Remember that a scheduled job requires the container to remain running; stopping the host stops the schedule.

A timezone mismatch is especially easy to mistake for a broken schedule. A job configured for a local evening can appear to run several hours early or late if the container remains on UTC while the schedule was interpreted in another zone.

Inbound Webhook

Use a Webhook or application-specific trigger when another service must start the workflow. A public webhook requires all of the following:

  • A hostname that resolves to the server running n8n.
  • A network path from the sender to that server, including firewall and security-group rules.
  • HTTPS, normally terminated by a reverse proxy or load balancer.
  • Proxy forwarding that preserves the request path and method and sends traffic to n8n’s port.
  • An active workflow for the production callback.

Test locally first, then call the production URL from the external service only after the public path is configured. If the sender cannot establish an HTTPS connection, the workflow will not receive anything to inspect, regardless of how correct the nodes are.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Activate the workflow deliberately

Activation changes a canvas you control into a process that can run without a click. Before turning it on, verify the trigger URL or schedule, credentials, expected payload, error behavior, and destination side effects. Keep the Manual Trigger version until the production trigger has completed at least one successful test.

Understand executions and fix failures

Open the Executions view to see run status, timing, and node output. Select a failed run and inspect the first node that reported an error rather than jumping to the final node. The execution guide supports retrying a failed execution with either the currently saved workflow or the original workflow used for that run. The choice matters when you changed the canvas after the failure.

Check these causes in order:

  1. Wrong timezone: compare both environment variables with the timezone expected by the Schedule Trigger.
  2. Missing or invalid credentials: open the node’s credential selector and verify that the selected credential still exists and has permission for the requested API.
  3. Workflow not active: a production schedule or webhook normally requires activation; a Manual Trigger does not.
  4. Unreachable webhook: check DNS, HTTPS certificate, reverse-proxy routing, firewall rules, and the server’s listening port.
  5. Incorrect data mapping: inspect the previous node’s actual JSON and remap fields from that output instead of relying on a remembered field name.
  6. Lost storage: confirm that the container still mounts /home/node/.n8n and that Compose did not create a different volume under a new project name.

For container-level problems, use:

docker ps
docker logs --tail=200 n8n
docker volume inspect n8n_data

With Compose, use docker compose ps and docker compose logs --tail=200 n8n. A healthy container does not prove that an API credential, schedule, or external webhook is configured correctly, so combine these logs with the execution record.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Make persistence and backups non-negotiable

What the volume protects

The mounted /home/node/.n8n directory contains the SQLite database, webhook URL, encryption key, credentials, and workflows for the standard single-container setup. If you remove the container without this mount, you can lose the instance’s identity and configuration even though the Docker image can be downloaded again.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the mount before any upgrade or migration:

docker inspect n8n --format '{{json .Mounts}}'

For Compose, inspect the service with docker compose config and confirm that the named volume resolves to /home/node/.n8n.

Back up the named volume

Stop or quiesce writes before a backup when possible. One practical archive method is:

mkdir -p ~/n8n-backups
docker run --rm 
  -v n8n_data:/data:ro 
  -v "$PWD/n8n-backups":/backup 
  alpine 
  tar czf /backup/n8n_data-$(date +%Y%m%d-%H%M%S).tar.gz -C /data .

Store the archive somewhere separate from the host. A backup that remains on the same disk does not protect against disk loss. Protect the archive because it contains workflow definitions, credentials, and the encryption material needed to use the stored data.

Restore carefully

Restore into a stopped n8n service and preserve the same volume name or update the Compose configuration deliberately. Do not overwrite a working volume without first making a second backup. After restoration, start n8n, sign in, open a non-destructive workflow, and run a controlled test before reactivating schedules or webhooks.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Secure a public self-hosted instance

  • Use HTTPS for the editor and every public webhook endpoint.
  • Restrict access to the editor and administrative paths; do not expose unnecessary Docker, database, or host-management ports.
  • Use strong owner-account authentication and create only the credentials each workflow needs.
  • Keep secrets in n8n credentials rather than expressions, notes, or exported workflow text.
  • Back up the volume and encryption key, and test that a restore is possible.
  • Review community and third-party nodes before installing them. A node with filesystem or network access can have consequences beyond the individual workflow.

After the first workflows are working, run the built-in audit from the container:

docker exec -it n8n n8n audit

The audit can report unused credentials, risky or community nodes, filesystem access, unprotected webhooks, missing security settings, and outdated-instance findings. Treat the report as a remediation list: remove unused credentials, protect webhook endpoints, update the instance during a maintenance window, and investigate any node that has broader access than its workflow requires.

SQLite or PostgreSQL?

SQLite PostgreSQL
Default choice for a small, single n8n instance. Documented production-oriented alternative for a larger or more demanding deployment.
Simple because the database lives in the n8n data directory. Separates database service operations from the n8n container and can fit an existing database platform.
Back up the /home/node/.n8n volume as part of the instance backup. Back up the database as well as the n8n data directory and keep the connection configuration consistent.

Do not switch databases merely because a workflow has two or three nodes. Consider PostgreSQL when execution volume, concurrency, availability requirements, or an established operations team justify the additional service and backup work.

Common problems and their fixes

Symptom Likely cause Fix
The browser cannot open the editor. The container is stopped or port 5678 is not mapped. Run docker ps, inspect logs, and confirm -p 5678:5678 or the Compose port mapping.
Workflows disappear after recreation. The container used no persistent volume or mounted a different volume. Mount the same named volume at /home/node/.n8n and verify it with docker volume inspect.
A schedule runs at the wrong hour. The schedule timezone and container timezone disagree. Set GENERIC_TIMEZONE and TZ to the intended IANA timezone, recreate the container, and test again.
A webhook never appears in Executions. The URL is private, DNS or HTTPS is wrong, the proxy does not forward correctly, or the workflow is inactive. Test the public HTTPS path from outside the server, inspect proxy and n8n logs, and activate only after the route works.
A node shows an empty value. The expression references a field that the previous node did not produce. Open the previous node’s execution output and map the exact field from the input pane.
An API request returns an authorization error. The credential is missing, expired, or lacks the required scope. Reauthorize or replace the credential in the credentials area and rerun the node without embedding a secret in the workflow.
The container repeatedly restarts. An environment, permission, image, or configuration error is preventing startup. Read the recent container logs, verify the volume is writable and mounted correctly, and correct the Compose environment before restarting.

A practical path from learning instance to always-on service

  1. Learn locally with Docker, a named volume, UTC, and a Manual Trigger.
  2. Build the smallest useful transformation and inspect every execution output.
  3. Add credentials through n8n’s credential store and test the external API without exposing secrets.
  4. Move the Compose project to a server that remains online if the workflow must run unattended.
  5. Set the intended timezone, configure HTTPS and DNS, and test a public webhook from an external network if you need one.
  6. Back up the volume and encryption material before enabling production triggers.
  7. Run the security audit, remove unnecessary access, and establish an update and restore routine.

This sequence keeps the first experiment reversible while ensuring that the features people most often lose during self-hosting—persistent storage, correct scheduling, reachable webhooks, and recoverable credentials—are addressed before production activation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Final checklist

  • Docker Engine and Docker Compose v2 are installed on the host.
  • The n8n service maps host port 5678 and loads successfully.
  • /home/node/.n8n is backed by a named volume.
  • The owner account is created before credentials are added.
  • A Manual Trigger and Edit Fields node execute successfully.
  • Data is mapped from actual node output, not guessed field names.
  • TZ and GENERIC_TIMEZONE match the intended schedule timezone.
  • Public webhooks use a reachable HTTPS hostname and an active workflow.
  • Execution history and container logs are checked when a run fails.
  • The volume, encryption key, and any external database are included in tested backups.
  • The security audit has been run and its findings reviewed.

Once these checks pass, replacing the Manual Trigger is a controlled configuration change rather than a leap into an untested public service.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

DockerDocker Composen8nself-hostingserver administrationwebhooksworkflow automation

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.