Why an npm-based n8n install has to move to Docker before n8n 3.0
n8n 3.0 no longer supports installations run with npm or npx, and n8n does not publish a runnable package to npm for that version. If your team starts n8n with npm or npx n8n, you need to move the instance to a Docker-based deployment before you upgrade, not after. The target is Docker, and the upgrade itself is a separate step once the instance runs in a container and you have tested it there.
The effort depends on how much your instance holds and where it keeps its data. The main drivers are the database (the default SQLite file or an external database such as PostgreSQL), the number of workflows and credentials, whether you use external binary data storage, and whether any custom nodes or local files sit outside the standard .n8n folder. Before you estimate, count these items and confirm them against your own environment. Ask any partner for a written scope that lists each of them.
If your team already runs n8n with Docker Compose, you do not need to switch. The one-line setup script at get.n8n.io is aimed at hosts that have no n8n instance yet, so it is not the path for an existing npm install. Read the n8n v3.0 breaking changes page before you plan the cutover, and confirm which settings in your current install carry over unchanged.
What carries over from an npm install and what needs rebuilding
This table compares each element of an npm or npx n8n install with its Docker Compose equivalent and marks what moves as-is, what must match, and what needs review. Read the rows in order: the encryption key and database decide whether existing workflows and credentials still work, while the base URL and custom node paths decide whether the instance behaves correctly after the move.
| Element | Source (npm or npx install) | Docker Compose target |
|---|---|---|
| ~/.n8n folder | Holds config, the encryption key, and the default SQLite database | Copy the folder contents into the volume mounted at the n8n data path, then verify ownership before first start |
| Encryption key | Stored in the .n8n folder, or set through an environment variable on the source | Must match exactly in the new environment, or stored credentials cannot be decrypted |
| SQLite database | Default local database inside the .n8n folder | Export workflows and credentials, then import into PostgreSQL, or keep SQLite only if you accept its limits |
| External database | Only present if the source already used PostgreSQL or MySQL | Carry over the database itself with a dump and restore, keeping the same name and schema; MySQL and MariaDB need migration first |
| Workflows | Stored in the database and exportable with the n8n CLI | Re-import after the database is in place, then confirm IDs, active states and trigger settings |
| Credentials | Encrypted with the instance key and stored in the database | Usable only with the same key; if the key differs, recreate each credential by hand |
| Custom nodes | Installed in a local directory under the .n8n folder or a path set by variable | Mount the same directory into the container and confirm the custom node path variable points to it |
| Environment variables | Set in the shell, a service file, or a .env file on the host | Move into the Compose file or an env file, including the key, timezone and database settings |
| Base URL and webhook URLs | Often localhost or a hostname set during the first run | Set the public base URL to the address users and external systems call, then re-register webhooks where needed |
| Reverse proxy and TLS | Commonly a host-level proxy in front of the npm process | Reconfigure the proxy to reach the container port and confirm forwarded headers reach n8n |
Which documented paths move the instance
The one-line setup, curl -fsSL | sh, checks that Docker is available, writes the configuration files and starts a new n8n instance. It builds a fresh Docker host and does not carry over an existing npm install, because it does not read your ~/.n8n folder or your current database. The n8n v3.0 breaking changes page explains that existing Docker Compose users do not need to switch to it.
- Fresh instance only: The script starts an empty instance. Workflows, credentials and execution history stay on the old host until you copy them over.
- Docker is a prerequisite: The script checks for Docker, so the target host needs a working Docker installation first.
- Existing Compose stacks stay as they are: If you already run n8n with Docker Compose, the upgrade does not require this script.
- Generated files need review: Check the database settings and encryption key handling the script writes before you load any data.
Confirm that the new instance starts, that you can sign in, and that its database and key match what you plan to carry over before you move any data.
A single-host npm install that keeps its default SQLite database has the simplest move. The data lives in the ~/.n8n folder, which also holds the credential encryption key. Copying that complete folder to a Docker host and mounting it into the container keeps workflows, credentials and the key together, so stored credentials still decrypt.
- Copy the whole folder: Move the complete
~/.n8nfolder, not only the SQLite file, because the encryption key lives there too. - Keep the key unchanged: Credentials are encrypted with that key. If the key changes, stored credentials cannot be read, so re-creating them is only a fallback for a lost key.
- Mount the copied folder: Confirm the container uses the copied folder and does not initialize a new one on first start. The data path depends on the image, so check it in the n8n Docker documentation.
- Test the copy on a second host: Run the copied instance without pointing production webhooks at it, then compare workflow counts and test a few credentials.
Confirm that a sample credential test passes and that a scheduled workflow runs on the new host before you stop the original.
If the instance will run on PostgreSQL, whether for a more durable database or to prepare for queue mode, the move is a migration between databases. n8n's CLI tooling for exporting and importing entities moves workflows and credentials into the new database, and the encryption key must still match. Confirm the exact command syntax and flags for your release in the n8n CLI documentation before you run anything against production data.
- Pause changes first: Stop editing workflows and pause triggers during the export, so the exported state matches what you intend to keep.
- Export entities from the source: Run the export command on the old instance and keep the output with your
~/.n8nbackup. - Import into an empty PostgreSQL database: Start the new Docker Compose stack with PostgreSQL, import the entities, then compare workflow and credential counts.
- Carry the same encryption key: Configure the new instance with the original key. Imported credentials cannot be decrypted with a different one.
Keep the source database untouched until the new stack has run your critical workflows and credential tests successfully.
A complete backup is more than one file. n8n's backup and restore documentation treats the .n8n user folder as the core, because it holds the credential encryption key and the default SQLite database. If you use an external database or external binary data storage, those belong in the backup too, captured at a matching point in time.
- User folder: Capture the
.n8nfolder with its encryption key. The key cannot be rebuilt, so losing it means losing access to stored credentials. - External database: Back up the external database with its own tooling, while the instance is stopped or quiesced, so it matches the folder.
- Binary data storage: If binary data lives outside the database and the folder, include that storage location in the same backup window.
- Restore test: Restore the set onto a scratch host and open a credential and a workflow to prove it works.
Write down which of these items your instance actually uses before you choose a migration path, because each path depends on a different subset.
How to move an npm install to Docker in phases
This sequence takes an npm or npx n8n instance to a Docker Compose deployment with PostgreSQL, using the same encryption key, and retires the npm install only after workflows, webhooks and credentials are verified. It produces a tested cutover path before the n8n 3.0 upgrade.
Inventory version, database, nodes and credentials
The engineer running the current instance records the exact n8n version, how it was started, which database it uses (the default SQLite or an external database), any custom nodes in the user folder, any external binary data storage, and the list of credentials and webhook endpoints in use. Confirm whether the instance runs through a reverse proxy and which hostnames and certificates it depends on. The step is complete when the team holds a written inventory that another engineer could use to rebuild the environment without asking questions.
Take a full backup before any change
Stop nothing yet. Copy the .n8n user folder, which holds the credential encryption key and the default SQLite database, and export or dump the external database and any external binary data storage. Store the copies outside the host being changed and record checksums. The backup is verified when a test restore of the copied files into a scratch location starts without errors and the key file matches the one on the live instance. Vendor guidance on backup and restore should be read before this step.
Build the Docker Compose stack with PostgreSQL
Write a Compose file that runs n8n in a Docker container alongside PostgreSQL, with a persistent volume for user data and the database. Set the database connection variables to point at PostgreSQL and place the original encryption key in the environment or the mounted configuration path so credentials decrypt on first start. Confirm the exact variable names and the current official Docker setup in n8n's documentation for your target version, since they change between releases. The step is complete when the container starts, connects to PostgreSQL and serves the editor on a local port.
Restore data into a staging instance
Bring up the Compose stack on a separate host or network segment that cannot send live webhooks or reach production systems. Import the database content and restore the .n8n folder contents, including the encryption key, and reinstall any custom nodes. Start n8n and check the log for decryption or migration errors. The step is complete when the workflow list, execution history and credential list match the inventory from the first step.
Test workflows, webhooks and credentials
Run each production-relevant workflow manually in staging, using test data and sandbox accounts where the target systems allow it. Call each webhook path with a test request and confirm the expected response. Open each credential and run its connection test, and check that outbound calls to external systems succeed from the new network location, including proxy and firewall rules. Record pass or fail for every item in a shared checklist. The step is complete when every item passes or has a documented fix and retest.
Run both instances in parallel
Keep the npm install running while the Docker instance is kept in a controlled state, with its scheduled triggers disabled or limited to test targets so that two instances do not process the same production events. Compare execution results and logs for a defined observation period agreed by the team. Confirm which instance owns each trigger before any switch. The step is complete when the team signs off that the Docker instance produces the same outcomes as the npm install.
Cut over DNS or the reverse proxy
Repoint the hostname or the reverse proxy upstream from the npm install to the Docker instance, then enable production triggers on the new instance and disable them on the old one in the same change window. Re-check webhook URLs that external systems call and update any that embed the old address. Confirm TLS certificates are valid for the hostname. The step is complete when live webhooks and scheduled workflows are running on the Docker instance and the old instance receives no production traffic.
Decommission the npm install before upgrading
After a stable period on the Docker instance, stop the npm process, keep the final backup of the old .n8n folder and database under the retention rules your organization applies, and remove the npm-based service definitions so nothing restarts it. Record the new version and deployment in the change log. Because n8n 3.0 no longer supports npm or npx installations, the Docker instance is the only target for the major upgrade. The step is complete when the old process is confirmed stopped and the team can name the one instance that runs production.
How the npm install, backup and Docker Compose stack connect
The path starts on the host where n8n runs from npm, moves through a backup of the .n8n folder and the external database, and lands in a staging Docker Compose stack with PostgreSQL. The encryption key must come across unchanged, or stored credentials will not decrypt. Tests run against staging and in parallel with the live instance before cutover, which should happen before the n8n 3.0 upgrade.
Migration path from npm install to Docker Compose before the 3.0 upgrade.
What drives the effort and duration of the move
This table lists the factors that change how much work an npm-to-Docker move takes, who typically pays for each piece, and whether the cost is one-time or recurring. Use it to scope internal work against a partner quote and to choose which questions to put in writing before work starts.
| Driver | Why it changes effort | Who pays and one-time or recurring | What to ask for in a quote |
|---|---|---|---|
| Workflow and credential count | Each workflow needs review for node versions, expressions and credential references, and each credential must be confirmed after restore. Large counts expand both review and retest. | Internal staff or partner, one-time. Review work scales with the count. | Itemized review method, sample size for functional tests and how credentials are verified. |
| Size of the SQLite database and binary data | A larger default database or local binary data folder means longer backup, copy and restore windows and more storage to validate on the new host. | Mostly internal infrastructure time, one-time. Storage costs recur if the Docker host is sized larger. | Confirm the migration path for SQLite data, where binary data lives and the restore test plan. |
| Custom nodes and external hooks | Custom node directories and hook files must be carried into the container image or mounted volume, and each one must load under the new runtime. Unmaintained code is the usual source of delay. | Internal developers or partner engineers, one-time. Ongoing maintenance recurs with each n8n release. | Inventory of custom nodes, dependency list, owner of each component and compatibility test for n8n 3.0. |
| Webhook URLs called by external systems | Production and test webhook URLs must stay stable or each external caller needs a change request. Path or host changes multiply coordination work. | Internal integration owners, one-time. Partner time covers URL mapping and cutover checks. | List of every caller, the owner of each system and a cutover plan that keeps old URLs answering during transition. |
| Reverse proxy and TLS setup | Docker Compose deployments need the proxy, certificate renewal and the WEBHOOK_URL-style host settings reviewed. Existing npm setups often terminate TLS in a separate proxy that must be reconfigured. | Platform or network team, one-time for setup. Certificate renewal recurs. | Proxy configuration review, certificate ownership, renewal process and DNS change steps. |
| Number of teams depending on the instance | More teams mean more sign-off, more workflows to validate and a higher cost of unplanned downtime during the cutover window. | Business owners and internal staff, one-time. Coordination time falls on the internal project lead. | Named approvers per team, a test sign-off process and a rollback decision owner. |
| Testing depth before the major upgrade | Testing covers workflow execution, credential use, webhooks, scheduled triggers and any custom code. Thin testing shifts risk into production after cutover. | Internal QA or partner, one-time for the initial test. Regression testing recurs with each upgrade. | Test matrix by workflow category, evidence format, defect handling and who signs off the result. |
| Backup and restore verification | A complete backup includes the .n8n folder with the encryption key and any external database. Missing either one can leave credentials unreadable after the move. | Internal operations, one-time for the first run. Scheduled backups recur. | Backup checklist, restore test in a separate environment and confirmation that the encryption key is preserved. |
What usually goes wrong during an npm to Docker move
Most failed npm to Docker moves break in the same few places: keys, files, URLs, duplicate running instances, skipped tests and configuration drift. Each risk below is easy to prevent if it is checked before cutover rather than discovered after users report errors.
Mismatched or lost encryption key
If the new container starts with a different encryption key than the one in the original ~/.n8n folder, every stored credential becomes unreadable and workflows that call them fail. Copy the key exactly, keep it out of shell history and version control, and confirm that the value in the new environment matches the original before importing data. Then open one credential in the UI and run a test workflow that uses it.
Forgotten binary data and custom nodes
A backup of the database alone misses files. Binary data stored outside the database, custom node folders and any files referenced by workflows will not follow the move unless you copy them. Inventory the ~/.n8n folder and any external storage paths before you start, then verify that a workflow reading a previously uploaded file still succeeds in the new instance.
Webhook URLs changing at cutover
Webhook addresses depend on the public host name and proxy settings. When the new Docker host uses a different domain, path or port, external systems keep calling the old address and receive errors or no response. List every inbound caller before cutover, set the webhook base URL to the public address, and test each endpoint from outside your network.
Workflows running in both instances
During a parallel run, active schedules and triggers can fire in the old npm instance and the new Docker instance at the same time. This duplicates messages, records and API calls. Deactivate workflows in the old instance once the new one is verified, and keep a written record of which instance owns each workflow during the transition.
Skipping the test before the 3.0 upgrade
Moving to Docker does not prove that the workflows will run after the major release. Run representative workflows, credential tests and webhook calls on the Docker instance while it is still on the current version, then review the 3.0 breaking changes against your node usage. Treat the upgrade as a separate, tested change with its own rollback point.
v3.0 breaking changesUnreviewed environment variables
Settings that worked under npm, such as timezone, encryption key, database connection, host name and execution limits, may not be carried into the Compose file. Some values are set by the shell session rather than the file system. Export the current environment, compare it with the Compose configuration line by line, and record the purpose of each variable so that no setting is lost or stored in plain text by accident.
Questions teams ask before moving n8n to Docker
How much effort does moving an npm-based n8n install to Docker take?
The effort depends mostly on how much state the instance holds and how many workflows and credentials depend on it. A small single-user instance on the default SQLite database is usually a contained move: copy the .n8n folder, confirm the encryption key, start the Docker Compose stack and test. Effort rises when the instance has an external database, custom nodes in the user folder, external binary data storage, many webhooks that external systems call, or custom startup scripts that wrap npx n8n. Each of these adds inventory, testing and cutover steps. Ask any partner for a quote that lists each of these items separately, so you can see which ones your instance triggers.
Can our internal team move n8n to Docker without outside help?
Yes, a team with Linux, Docker and database administration skills can do this work in-house, because the upgrade path is documented and the steps are well defined. The questions to answer first are whether anyone has run Docker Compose in production, who owns the database and backups, and who can make the cutover decision. If those roles are thin, an outside partner can take on planning, the Compose and proxy configuration, test scripts and the cutover runbook while your team keeps ownership of the data and approvals. DeployOpen implements, hardens, backs up and documents self-hosted platforms in the client's own infrastructure, so the split of work can be written into a fixed scope before work starts.
What does the migration need from our team?
Plan for four inputs. First, access: administrator rights on the current host, the database connection details, the .n8n folder and the Docker host. Second, backups: a complete copy of the .n8n folder, which holds the credential encryption key and the default SQLite database, plus a snapshot of any external database and binary data storage. Third, a maintenance window agreed with the business owners of the workflows that run on schedule or receive webhooks. Fourth, named test owners who can confirm that critical workflows still run, credentials still connect and webhook URLs still respond. Without test owners, the move can finish technically and still fail in ways nobody notices until a business process breaks.
How long should the parallel run last before we switch off the old npm install?
The parallel run should last until your test owners have verified every critical workflow on the new Docker instance and at least one full cycle of its scheduled and event-driven work has completed without errors. The length depends on how often workflows run, how many execution types you have, and how quickly your team can review logs. A workflow that runs monthly needs a longer observation window than one that runs every few minutes. Decide the window and exit criteria in writing before the parallel run starts, and keep the old install stopped from writing data during cutover so the two copies do not diverge. Avoid running both instances against the same external webhooks at once unless your test plan covers the duplicate execution risk.
Does moving to Docker Compose change our n8n license or plan requirements?
Moving the deployment method does not change the license. n8n is licensed under the Sustainable Use License, which allows use or modification only for your own internal business purposes or for non-commercial or personal use, so review that text against how your organization uses the instance. Plan requirements depend on the features you use, not on the install method. SSO and LDAP, environments with Git, and log streaming are included only in the Business and Enterprise plans according to n8n's pricing page. Files with .ee in their name or directory need a valid Enterprise License. Confirm with n8n directly which edition and license terms apply to your use before you commit to a deployment design.
Do we have to move to PostgreSQL as part of this move?
Not necessarily for the Docker move itself. An npm install using the default SQLite database can be carried into a Docker deployment with the .n8n folder, and the Docker move is the right point to decide the database. PostgreSQL becomes important when you plan queue mode, which runs workers that read and write workflow data in PostgreSQL, or when you need the database to be backed up and recovered on a standard schedule. If you already run MySQL or MariaDB, check the current n8n release notes and the sibling migration guidance before changing the database. Make the database decision in the planning phase, because changing it during cutover adds a second migration to the same window.
What should we check after the move before we call it finished?
Check the things that break quietly. Confirm the encryption key in the new environment matches the one in the old .n8n folder, because credentials cannot be read without it. Run a test of each credential, verify that scheduled workflows fire at the expected times, and call each production webhook from the systems that use it. Confirm the public URL, proxy and certificate settings, and that execution history and logs are written where your team expects. Finally, run a backup and a restore test on the Docker deployment, so you know the new backup procedure works before the old copy is retired.
Does moving to Docker change n8n license terms or plan needs?
Moving from an npm install to Docker does not change your license or the features you are entitled to. n8n is source-available under the Sustainable Use License, not OSI open source, and that license applies to the software itself, whatever runtime you choose. The Community edition is free for self-hosting under the license's terms, which allow use for your own internal business purposes or for non-commercial and personal use. Check the n8n LICENSE.md against how your organization uses the instance before you rebuild it, particularly if you distribute modified copies or run it for outside parties.
Plan needs also stay the same. Features such as SSO and LDAP, environments with Git, and log streaming sit in the Business and Enterprise plans, so a Community instance on npm that lacks them will still lack them under Docker Compose. Any file with .ee in its name or directory requires a valid Enterprise License, and the container image does not grant that license. If your current deployment depends on a paid feature, confirm the license is already in place. Do not assume that a Docker image carries entitlements that the npm install did not have.
Before the move, confirm current plan terms on the n8n pricing page. Pricing and plan contents change, and the page is the source for what each edition includes today. Ask your n8n account contact or review the terms in writing for any feature you expect to need after the upgrade. Record the plan and features in your change ticket so that the migration owner, security reviewers and finance can match what runs in production against what is licensed.
What the target Docker Compose stack includes
A Docker Compose stack for n8n is only as reliable as the four pieces around the application container. Each piece below has a distinct job, and each one carries data or settings that the migrated instance depends on. Check every component before the first production cutover, not after.
The n8n container and its data volume
The n8n container runs the application, and the persistent volume mounted at the .n8n path holds the encryption key and any local state. Mount that volume explicitly in the Compose file so it survives image updates and container recreation. Confirm that the N8N_ENCRYPTION_KEY value you carried over from the npm install is set in the environment and matches the key in the old ~/.n8n/config file. A mismatch leaves existing credentials unreadable, and the error often appears only when a workflow runs.
PostgreSQL as the primary database
PostgreSQL replaces the default SQLite file that the npm install used, and it holds workflows, executions and credential records. Run it as its own service with a named volume, and give it credentials that the n8n container reads from secrets or an environment file rather than from the Compose file itself. Verify that the import of workflows and credentials completed by counting them in both databases before you switch traffic. Queue mode later depends on this same database, so the setup choice matters beyond this migration.
Reverse proxy, TLS and base URL
A reverse proxy terminates TLS in front of n8n and forwards requests to the container. Set the public base URL and webhook URL in the n8n configuration so that editor links, OAuth callbacks and webhook addresses point to the hostname users and external services actually call. A wrong base URL is one of the most common causes of broken webhooks after a move. Test a certificate chain from outside your network, and confirm that webhook paths return the expected response before you update DNS or external integrations.
Scheduled backups of database and volumes
A complete backup covers the database dump and the .n8n volume together, because the encryption key lives in the volume and the data it protects lives in the database. Schedule a job that writes both to storage outside the Docker host, and keep the key copy separate from the database copy. Restore the backup into a scratch stack at least once before go-live, and confirm that a restored instance decrypts a test credential. Ask your team who owns retention and how long old copies are kept, since the requirement is set by your policy, not by n8n.

