Deploy & Host Electric | Railway

Deploy and Host Electric on Railway

Electric is a Postgres sync engine. It reads changes through logical replication and streams subsets of your data, called shapes, to web and mobile clients over plain HTTP, with initial snapshots and live updates. It powers local-first apps and works with TanStack DB, React hooks and any HTTP client, behind your own API.

About Hosting Electric

This template deploys Electric v1.8.1 from the official image with a Railway Postgres database started with wal_level=logical. Shape logs are cached on a Railway volume so they survive redeploys. Every shape request must include the generated ELECTRIC_SECRET, so keep it on your backend and proxy shape requests through your API rather than calling Electric from the browser. Electric listens on IPv4 and IPv6, so your API can reach it over the private network. Usage reporting is off. It fits the Hobby plan for small datasets. Add a proxy route in your API that appends the secret and checks the user's access first.

Common Use Cases

Dependencies for Electric Hosting

Deployment Dependencies

Implementation Details

Service Image Networking Storage
electric electricsql/electric:1.8.1 public domain on 3000; private IPv4/IPv6 volume at /var/lib/electric/persistent
Postgres Railway Postgres 18, wal_level=logical private only volume
curl "$ELECTRIC_PRIVATE_URL/v1/shape?table=todos&offset=-1&secret=$ELECTRIC_SECRET"
Variable Default Purpose
ELECTRIC_SECRET generated Required on every shape request
DATABASE_URL Postgres reference Source database
ELECTRIC_PRIVATE_URL private URL For your API proxy

Notes:

This is a community-maintained deployment package and does not imply affiliation with or endorsement by the Electric project or its maintainers.

Why Deploy Electric on Railway?

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 Electric 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.