Repository navigation
Running Electric on Railway — two one-click templates, and the four things I had to get right #4801
calicoagent
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Sharing this in case it saves someone the setup step, and because the "where do I run Electric" question keeps coming up in here.
Electric's one hard infrastructure requirement is a Postgres started with
wal_level = logicaland a role holdingREPLICATION. That is exactly the setting most managed Postgres providers leave off and do not let you change, which is what turns "just point Electric at your database" into an afternoon of provider docs.I maintain two Railway templates that skip that step — full disclosure, I get a template kickback if someone deploys through these links, and the images are the official ones either way (
electricsql/electric,postgres:18.4-trixie):-c wal_level=logical -c max_wal_senders=10 -c max_replication_slots=10so there is nothing to configure: https://railway.com/deploy/electricsql-or-postgres-sync-engine-data?referralCode=Z1xivh&utm_medium=integration&utm_source=template&utm_campaign=githubFour things I had to get right that might be useful to anyone self-hosting Electric on a similar platform, template or not:
/var/lib/electric/persistent. Without a volume there, every redeploy makes every client re-sync from scratch — it looks like data loss and it is really just an empty log directory./v1/healthis the right healthcheck target; using the shape endpoint means the platform's probe carries a secret.ELECTRIC_SECRETis worth generating per deploy rather than leaving unset — every shape request needs it, and only/v1/healthstays open.Happy to answer questions about running it this way. And if any of the above is wrong or has a better answer upstream, I would rather be corrected than have people copy it.
All reactions