packages/twenty-docs/developers/self-host/capabilities/setup.mdx
Twenty offers two configuration modes to suit different deployment needs:
Admin panel access: Only users with admin privileges (canAccessFullAdminPanel: true) can access the configuration interface.
IS_CONFIG_VARIABLES_IN_DB_ENABLED=true # default
Most configuration happens through the UI after installation:
http://localhost:3000)What you can configure through the admin panel:
Complete technical reference → </Warning>
IS_CONFIG_VARIABLES_IN_DB_ENABLED=false
All configuration managed through .env files:
IS_CONFIG_VARIABLES_IN_DB_ENABLED=false in your .env file.env fileBy default, Twenty runs in single-workspace mode — ideal for most self-hosted deployments where you need one CRM instance for your organization.
IS_MULTIWORKSPACE_ENABLED=false # default
canImpersonate and canAccessFullAdminPanel)https://your-domain.comIS_MULTIWORKSPACE_ENABLED=true
DEFAULT_SUBDOMAIN=app # default value
Enable multi-workspace mode for SaaS-like deployments where multiple independent teams need their own workspaces on the same Twenty instance.
Key differences from single-workspace mode:
sales.your-domain.com, marketing.your-domain.com){DEFAULT_SUBDOMAIN}.your-domain.com (e.g., app.your-domain.com)When using multi-workspace mode, configure your DNS with a wildcard record to allow dynamic subdomain creation:
*.your-domain.com -> your-server-ip
This enables automatic subdomain routing for new workspaces without manual DNS configuration.
In multi-workspace mode, you may want to limit who can create new workspaces:
IS_WORKSPACE_CREATION_LIMITED_TO_SERVER_ADMINS=true
When enabled, only users with canAccessFullAdminPanel can create additional workspaces. Users can still create their first workspace during initial signup.
https://{your-domain}/auth/google/redirect (for SSO)https://{your-domain}/auth/google-apis/get-access-token (for integrations)MESSAGING_PROVIDER_GMAIL_ENABLED=trueCALENDAR_PROVIDER_GOOGLE_ENABLED=trueAUTH_GOOGLE_CLIENT_ID={client-id}AUTH_GOOGLE_CLIENT_SECRET={client-secret}AUTH_GOOGLE_CALLBACK_URL=https://{your-domain}/auth/google/redirectAUTH_GOOGLE_APIS_CALLBACK_URL=https://{your-domain}/auth/google-apis/get-access-tokenRequired scopes (automatically configured): See relevant source code
https://www.googleapis.com/auth/calendar.eventshttps://www.googleapis.com/auth/gmail.readonlyhttps://www.googleapis.com/auth/profile.emails.readIf your app is in test mode, you will need to add test users to your project.
Under OAuth consent screen, add your test users to the "Test users" section.
You will need to create a project in Microsoft Azure and get the credentials.
On Microsoft Azure Console enable the following APIs in "Permissions":
Note: "Mail.ReadWrite" and "Mail.Send" are only mandatory if you want to send emails using our workflow actions. You can use "Mail.Read" instead if you only want to receive emails.
You need to add the following redirect URIs to your project:
https://{your-domain}/auth/microsoft/redirect if you want to use Microsoft SSOhttps://{your-domain}/auth/microsoft-apis/get-access-tokenMESSAGING_PROVIDER_MICROSOFT_ENABLED=trueCALENDAR_PROVIDER_MICROSOFT_ENABLED=trueAUTH_MICROSOFT_ENABLED=trueAUTH_MICROSOFT_CLIENT_ID={client-id}AUTH_MICROSOFT_CLIENT_SECRET={client-secret}AUTH_MICROSOFT_CALLBACK_URL=https://{your-domain}/auth/microsoft/redirectAUTH_MICROSOFT_APIS_CALLBACK_URL=https://{your-domain}/auth/microsoft-apis/get-access-tokenIf your app is in test mode, you will need to add test users to your project.
Add your test users to the "Users and groups" section.
After configuring Gmail, Google Calendar, or Microsoft 365 integrations, you need to start the background jobs that sync data.
Register the following recurring jobs in your worker container:
# from your worker container
yarn command:prod cron:messaging:messages-import
yarn command:prod cron:messaging:message-list-fetch
yarn command:prod cron:calendar:calendar-event-list-fetch
yarn command:prod cron:calendar:calendar-events-import
yarn command:prod cron:messaging:ongoing-stale
yarn command:prod cron:calendar:ongoing-stale
yarn command:prod cron:workflow:automated-cron-trigger
You will need to provision an App Password.
Keep in mind that if you have 2FA enabled, you will need to provision an App Password.
smtp4dev is a fake SMTP email server for development and testing.
docker run --rm -it -p 8090:80 -p 2525:25 rnwood/smtp4devSet STORAGE_TYPE=S_3 and configure the STORAGE_S3_* variables through the admin panel or .env. See the config-variables.ts reference for the full list of S3 variables.
When using S3 with CORS-dependent features (e.g. in-browser file downloads), make sure your bucket allows your Twenty frontend origin in its CORS configuration.
Twenty supports logic functions for workflows and the code interpreter for AI data analysis. Both run user-provided code and require explicit configuration for security.
In production (NODE_ENV=production): Both logic functions and code interpreter default to Disabled. You must explicitly enable them with LOGIC_FUNCTION_TYPE and CODE_INTERPRETER_TYPE if you need these features.
In development (NODE_ENV=development): Both default to LOCAL for convenience when running locally.
<Warning> **Security Notice:** The local driver (`LOGIC_FUNCTION_TYPE=LOCAL` or `CODE_INTERPRETER_TYPE=LOCAL`) runs code directly on the host in a Node.js process with no sandboxing. It should only be used for trusted code in development. For production deployments handling untrusted code, use `LOGIC_FUNCTION_TYPE=LAMBDA` or `CODE_INTERPRETER_TYPE=E2B` (with sandboxing), or keep them disabled. </Warning>| Driver | Environment Variable | Use Case | Security Level |
|---|---|---|---|
| Disabled | LOGIC_FUNCTION_TYPE=DISABLED | Disable logic functions entirely | N/A |
| Local | LOGIC_FUNCTION_TYPE=LOCAL | Development and trusted environments | Low (no sandboxing) |
| Lambda | LOGIC_FUNCTION_TYPE=LAMBDA | Production with untrusted code | High (hardware-level isolation) |
For development:
LOGIC_FUNCTION_TYPE=LOCAL # default when NODE_ENV=development
For production (AWS):
LOGIC_FUNCTION_TYPE=LAMBDA
LOGIC_FUNCTION_LAMBDA_REGION=us-east-1
LOGIC_FUNCTION_LAMBDA_ROLE=arn:aws:iam::123456789:role/your-lambda-role
LOGIC_FUNCTION_LAMBDA_ACCESS_KEY_ID=your-access-key
LOGIC_FUNCTION_LAMBDA_SECRET_ACCESS_KEY=your-secret-key
To disable logic functions:
LOGIC_FUNCTION_TYPE=DISABLED # default when NODE_ENV=production
| Driver | Environment Variable | Use Case | Security Level |
|---|---|---|---|
| Disabled | CODE_INTERPRETER_TYPE=DISABLED | Disable AI code execution | N/A |
| Local | CODE_INTERPRETER_TYPE=LOCAL | Development only | Low (no sandboxing) |
| E2B | CODE_INTERPRETER_TYPE=E_2_B | Production with sandboxed execution | High (isolated sandbox) |