---
title: "Deploy Twenty CSV Import"
description: "Import contacts, companies and deals into Twenty from CSV"
category: "Other"
url: https://railway.com/deploy/deploy-twenty-crm-csv-import
---

# Deploy Twenty CSV Import

Import contacts, companies and deals into Twenty from CSV

**[Deploy Twenty CSV Import on Railway](https://railway.com/template/deploy-twenty-crm-csv-import)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deploy-twenty-crm-csv-import/manifest.json

- **Creator:** onepush
- **Category:** Other

## Template content

### twenty-worker

- **Image:** twentycrm/twenty:v2.48.0@sha256:43fab4bffacdcd63ff3c9257b7f8985a4424d81e9eb43982b9c16a841d555e52
- **Start command:** `/app/entrypoint.sh yarn worker:prod`

### twenty

- **Image:** twentycrm/twenty:v2.48.0@sha256:43fab4bffacdcd63ff3c9257b7f8985a4424d81e9eb43982b9c16a841d555e52
- **Health check:** /healthz
- **Public domain:** Yes

### Redis

- **Image:** redis:8.2.10@sha256:47670742d7924adbcdb404d1288b6327815b23141969c0939b8e5d61f78c2634
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH --maxmemory-policy noeviction --bind '* -::*'"`

### Postgres

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:16.15@sha256:34c3e49e7ed2aaef6c575fb23bb37b878007e97752d3bf27ccb550046f893ca7

## Documentation

# Deploy and Host self hosted Twenty CSV Import (CSV Import for Self-Hosted CRM) on Railway

This template runs a self-hosted Twenty CRM on Railway for loading contacts, companies and opportunities from spreadsheets without per-seat fees.

## About Hosting Twenty CSV Import open-source software on Railway (self hosted CSV import for self-hosted Twenty CRM template)

This template runs the official Twenty image, so your People, Companies and Opportunities data lives in a Postgres database you control.

Railway provisions Postgres 16 and Redis 8.2 and generates APP_SECRET and ENCRYPTION_KEY for you.

## Why Deploy Twenty CSV Import, the HubSpot alternative on Railway (Railway Free Trial)

Moving off HubSpot trades hosted convenience for control: your contacts, companies and opportunities live in your own Postgres, with no per-seat fees.

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Twenty CSV Import on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

### Railway vs Other Hosting Providers and VPS for Twenty CSV Import self hosting

Here is how Railway compares with raw servers for running Twenty imports.

| Provider | What You Get with Railway | What You Get with the Other Provider |
| --- | --- | --- |
| DigitalOcean | The twenty server, twenty-worker, Postgres 16 and Redis 8.2 deploy from one template with volumes wired up. | A droplet you control fully, but you install Docker, Postgres and Redis yourself. |
| AWS | Services and variables are configured in one place, with no VPC or IAM setup before your first upload. | Fine-grained control and many managed options, but considerably heavier setup. |
| Hetzner | A public domain with HTTPS, so imports run without you tuning the host. | Strong hardware value, but you own patching, backups and the worker process. |

Railway trades some control for a faster path to a working import pipeline.

## Common Use Cases for hosted Twenty CSV Import

- **Migrating a legacy spreadsheet of contacts and accounts:** Export the old list to CSV, import Companies first, then People with a companyId column. Download the template first so your headers match.
- **Importing opportunities linked to existing companies by domain:** Companies are unique on domain, so deal rows can reference accounts that way. Import Companies before deals or the relation will not resolve.
- **Loading custom-object records from an XLSX export:** Twenty accepts XLSX and XLS alongside CSV, one object type per file. Create custom fields under Settings, Data Model first, because import creates records but not fields.
- **Bulk-restoring soft-deleted records through re-import:** A row matching a soft-deleted record's unique value restores that record instead of duplicating it. Check the restored rows before trusting them.
- **Exporting a filtered View of People for handoff or backup:** Set filters and visible columns first, since export only includes what the view shows. Exports cap at 20,000 records, so split larger lists.

## Dependencies for Twenty CSV Import Docker hosted on Railway

Twenty CSV Import runs as four cooperating services, and imports depend on all of them.

### Deployment Dependencies for Managed Twenty CSV Import Service (CRM)

The twenty service uses the official Twenty image on port 3000 with a health check on /healthz, and it mounts a volume at /app/packages/twenty-server/.local-storage for uploaded files.

### Implementation Details for Twenty CSV Import (Using Twenty official docker image)

Set SERVER_URL to https://RAILWAY_PUBLIC_DOMAIN, wire PG_DATABASE_URL and REDIS_URL to their services, and keep STORAGE_TYPE=local so uploads land on the mounted volume.

## How does Twenty CSV Import compare against other ways to import people, companies and deals into a CRM

Each CRM handles the spreadsheet step differently. Here is where Twenty fits and where the others win.

### Twenty CSV Import vs HubSpot (HubSpot Alternative)

- **Import Ceiling:** Twenty takes up to 10,000 records per CSV file and points larger migrations to the API. HubSpot's import tools suit most small teams without hitting limits.
- **Relation Matching:** Twenty links People to Companies through a unique field like domain or companyId, so you import Companies first. HubSpot is more forgiving about order.
- **Cost of Staying:** Self-hosted Twenty costs a Railway bill instead of per-hub fees. HubSpot's free tier is easier to start on with no infrastructure.

### Twenty CSV Import vs Salesforce (Salesforce Alternative)

- **Field Creation:** In Twenty you create custom fields under Settings, Data Model first, because a CSV creates records but not fields. Salesforce's admin tooling is far deeper for enterprise schemas.
- **Licensing Model:** Self-hosted Twenty avoids per-user licensing, the main reason teams leave Salesforce. Salesforce still wins on ecosystem depth.

### Twenty CSV Import vs Pipedrive (Pipedrive Alternative)

- **Pipeline Focus:** Pipedrive is built around the deal pipeline, so importing opportunities feels natural there. Twenty treats opportunities as one object among many.
- **Seat Costs:** Pipedrive charges per seat, which adds up as you invite people. Twenty self-hosted has no seat fee, though you own the uptime.
- **Ease of Setup:** Pipedrive works from the first login. Twenty asks you to run Postgres and Redis, which takes more work up front.

### Twenty CSV Import vs Attio (Attio Alternative)

- **Data Model Flexibility:** Attio and Twenty both let you shape the data model freely. Attio's interface is more polished for daily browsing.
- **Hosting Control:** Twenty runs in your own Railway project, so the data lives where you put it. Attio is hosted for you, which is simpler but gives less database control.
- **Import Review:** Twenty walks you through a template download, column mapping and a yellow-highlight review before you confirm, which catches more bad rows in large batches.

## How to use Twenty CSV Import (the OSS CRM)?

1. Create any custom fields first under Settings &gt; Data Model, since CSV import does not create fields.
2. Open the object (for example Companies), click the three-dot menu on the top right, then choose Import records.
3. Download the template file from the import flow so your columns match.
4. Import Companies first, then People with companyId values, then Opportunities, then custom objects with relations.
5. Upload your CSV (up to 10,000 records per file), map columns to Twenty fields, and review rows highlighted in yellow.
6. Fix flagged rows in the UI, then confirm. For exports, open the object, configure the view, open the three-dot menu, choose Export view and save the CSV.

A Companies file looks like this:

```
name,domainName,employees
Acme Corp,acme.example,120
Globex,globex.example,45
```

A People file links to those companies through companyId:

```
firstName,lastName,email,companyId
Ada,Lovelace,ada@acme.example,
Grace,Hopper,grace@globex.example,
```

## How to self host Twenty CSV Import on other VPS Services (Twenty self hosting guide)

Run Twenty on any VPS with Docker, Postgres and Redis.

### Clone the Repository

Clone the repo and move into the Docker compose folder.

```bash
git clone https://github.com/twentyhq/twenty.git
cd twenty/packages/twenty-docker
```

### Install Dependencies

You need Docker and Docker Compose. Upstream suggests at least 2 GB of RAM.

```bash
docker --version
docker compose version
```

### Configure Environment Variables

Set the public URL, the secrets, and the database and cache connections.

```bash
SERVER_URL=https://your-domain
APP_SECRET=your-generated-32-char-secret
ENCRYPTION_KEY=your-generated-32-char-secret
PG_DATABASE_URL=postgres://user:password@your-postgres-host:5432/twenty
REDIS_URL=redis://your-redis-host:6379
STORAGE_TYPE=local
```

### Start the Twenty CSV Import Application

Bring the stack up, open your domain, and sign up, since the first user creates the workspace.

```bash
docker compose up -d
docker compose logs -f server
```

Railway handles the managed Postgres, Redis, TLS and worker process for you, which you would otherwise maintain yourself on a VPS.

## Official Pricing of Twenty CSV Import (Twenty pricing)

Twenty CSV Import is free and open source under AGPL-3.0, so the software costs nothing to run.

## Twenty CSV Import cloud vs self hosted comparison (Pricing, features, costs, and more)

Self hosting Twenty gives you the same CSV import flow as the cloud product.

### Monthly cost of self hosting Twenty CSV Import on Railway

Railway's usage-based pricing for the server, worker, Postgres and Redis services typically lands around $10-25 per month for small-team use.

### System Requirements for Hosting Twenty CSV Import on a VPS

Upstream Twenty suggests at least 2 GB of RAM, which is a sensible floor if the worker runs on the same machine.

## Frequently Asked Questions (FAQs)

### Do fields have to exist before I import a CSV?

Yes.

### Why are some rows highlighted in yellow after I upload?

Yellow rows are ones Twenty could not map cleanly, such as a bad value or an unresolved relation.

### How do People link to Companies through companyId?

Put the related Company's unique value in the companyId column.

### What happens if an imported row matches a soft-deleted record?

Uniqueness counts soft-deleted records, so a matching row restores the deleted record instead of creating a new one.

### When should I switch from CSV to the API for large imports?

CSV import is capped at 10,000 records per file, so anything bigger should go through the API.

### Why are my exported columns missing?

Export only includes columns visible in the current view.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/deploy-twenty-crm-csv-import
