
Deploy Aphex Website (Postgres + S3)
Aphex Website Template using Postgres & S3
aphex-website
Just deployed
Just deployed
/var/lib/postgresql/data
Bucket
Bucket
Just deployed
Deploy and Host Aphex CMS on Railway
Aphex CMS is an open-source, developer-first content management system built on SvelteKit. Unlike headless CMSes, it is embedded: the same app that serves your website also runs the editing studio, so there is no separate backend to deploy and no content API to wire up. This template deploys a complete, editable website — a block-based page builder, a blog, full-text search and visual editing — backed by PostgreSQL and S3-compatible object storage.
About Hosting Aphex CMS
Hosting Aphex means running one SvelteKit container alongside a PostgreSQL database and an
object store for uploaded media. The app serves the public site, the /admin studio, a
REST and GraphQL API, and an MCP endpoint from the same process.
It needs three things to work correctly, and this template arranges all of them: a database it can migrate on boot, a bucket for media that survives redeploys, and a public URL it can derive its own origin from. Migrations run automatically at container start. The background job queue — scheduled publishing, event consumers — runs in-process, so no separate worker service or cron is required at a single replica. Session secrets and the plugin-secret encryption key are generated once at deploy and must then stay stable for the life of the instance.
Uploaded media is never served from the bucket directly. Every asset is addressed through
the app at /media/:id/:filename, which is what lets private files stay private and
resized variants be generated on demand and cached permanently.
Why Deploy Aphex CMS 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 Aphex CMS 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.
Specifically for Aphex, Railway removes the two setup steps that normally stand between you and a working CMS. The Postgres service and the Bucket service are provisioned and wired to the app automatically, so there are no required fields on this template — no database URL to paste, no S3 account to create, no access keys to generate. Railway also supplies the public domain, which the container reads at startup to derive its own auth origin, so sign-in works on the first boot without you configuring a URL.
Common Use Cases
- Marketing and company websites — a block-based page builder with reusable layout blocks and four hero treatments, editable by non-developers without touching code.
- Blogs and publications — dated articles with rich text, inline media and code blocks, categories, related posts, a paginated archive and full-text search.
- Client sites built by agencies — define the content model in TypeScript, hand over a studio with roles, invitations and per-field access control, and let the client edit visually on the live page.
- Content backends for teams already using SvelteKit — a typed Local API for server code, plus REST, GraphQL and an MCP server so AI agents can read and write content.
Dependencies for Aphex CMS Hosting
- PostgreSQL — content, users, sessions and the job queue.
- S3-compatible object storage — uploaded media.
Deployment Dependencies
- Aphex CMS documentation
- Railway deployment guide
- Source repository
- Resend — optional, required for password reset, email verification and team invitations.
Implementation Details
First steps after deploying
- Go to
/loginand create your account immediately. The first account to sign up becomes super admin. On a public URL that is a race, so either setAPHEX_BOOTSTRAP_EMAILbefore deploying or claim the instance as soon as it is live. - Open
/admin. Your organization and roles are created for you on first sign-in. - Example content — real articles, images and navigation — is created on the first boot,
so every block and page has something in it. Set
APHEX_SEED=falseto start empty. - Edit Site Settings, Header and Footer to make it yours.
Optional environment variables
| Variable | Effect |
|---|---|
APHEX_BOOTSTRAP_EMAIL | Restricts the super-admin claim to one address. |
RESEND_API_KEY, APHEX_EMAIL_FROM | Enables password reset, email verification and invitations. |
AUTH_REQUIRE_EMAIL_VERIFICATION | Requires a verified email to sign in. Only turn this on after email works, or the first sign-up cannot complete. |
APHEX_SEED | Set false to skip the example content. |
Things that will bite you
- Keep every service in the same region. Railway sets the region per service. If the app and Postgres end up in different regions, every page render waits on cross-region round trips and the site becomes dramatically slower — with no error anywhere.
AUTH_SECRETandAPHEX_SECRET_ENCRYPTION_KEYmust stay stable. Rotating the first signs everyone out and invalidates every API key; rotating the second makes stored plugin secrets permanently unreadable.- Without email configured, a lost password is unrecoverable. The account you sign up with is the only way in.
- Scaling past one replica requires turning off
APHEX_EMBEDDED_WORKERand drivingPOST /api/internal/workers/runfrom a cron service withAPHEX_WORKER_SECRETset. Turning it off without a replacement leaves nothing processing the queue: scheduled publishes are accepted, report success, and never happen.
Prefer to build locally? pnpm create aphex scaffolds the same template on your
machine, using SQLite with no infrastructure to run.
Template Content
aphex-website
IcelandicIcecream/aphex-websiteBucket
Bucket