Back to Twenty

Local Server

packages/twenty-docs/developers/extend/apps/getting-started/local-server.mdx

2.7.32.8 KB
Original Source

Managing the local server

Use yarn twenty docker:* to control the local Twenty container:

CommandWhat it does
yarn twenty docker:startStart the server (pulls the image if needed)
yarn twenty docker:start --port 3030Start on a custom port
yarn twenty docker:stopStop the server (preserves data)
yarn twenty docker:statusShow URL, version, and login credentials
yarn twenty docker:logsStream server logs
yarn twenty docker:resetWipe data and start fresh
yarn twenty docker:upgradePull the latest twenty-app-dev image
yarn twenty docker:upgrade 2.2.0Upgrade to a specific version

Data persists across restarts in two Docker volumes (twenty-app-dev-data for PostgreSQL, twenty-app-dev-storage for files). Use reset to wipe everything.

Upgrading the server image

yarn twenty docker:upgrade pulls the latest image, compares digests, and only recreates the container if anything actually changed. Volumes are preserved — only the container is replaced. If a new image was pulled and the container was running, the upgrade automatically starts a new container; run yarn twenty docker:start afterward to wait for it to become healthy.

bash
yarn twenty docker:upgrade            # Latest
yarn twenty docker:upgrade 2.2.0      # Specific version

Verify the running version with yarn twenty docker:status (it shows the APP_VERSION baked into the container).

Running a parallel test instance

Pass --test to any docker:* command to manage a second, fully isolated instance — useful for integration tests or experiments without touching your main dev data:

CommandWhat it does
yarn twenty docker:start --testStart the test instance (defaults to port 2021)
yarn twenty docker:stop --testStop it
yarn twenty docker:status --testShow its status
yarn twenty docker:logs --testStream its logs
yarn twenty docker:reset --testWipe its data
yarn twenty docker:upgrade --testUpgrade its image

The test instance has its own container (twenty-app-dev-test), volumes (twenty-app-dev-test-data, twenty-app-dev-test-storage), and config — it runs alongside your main instance without conflicts. Combine --test with --port to override 2021.

Manual setup (without the scaffolder)

Skip the scaffolder if you're adding the SDK to an existing project:

bash
yarn add twenty-sdk twenty-client-sdk

Add the script to package.json:

json
{
  "scripts": {
    "twenty": "twenty"
  }
}

You can now run yarn twenty dev, yarn twenty docker:start, and the rest.

<Note> Don't install `twenty-sdk` globally — pin it per project so each app uses its own version. </Note>