
Deploy Overleaf
Deploy and Host Overleaf with Railway
Overleaf
Just deployed
/var/lib/overleaf
Redis
Just deployed
/data
MongoDB
Just deployed
/data
Deploy and Host Overleaf on Railway
Overleaf Community Edition is a self-hosted online LaTeX editor for writing, compiling, and collaborating on scientific documents in the browser. It gives you the Overleaf editing experience on your own infrastructure, with projects, real-time preview, and history stored under your control.
About Hosting Overleaf
Hosting Overleaf means running the web app alongside MongoDB and Redis. Project files live on disk, document metadata lives in MongoDB, and sessions plus real-time collaboration state live in Redis. MongoDB must run as a replica set so Overleaf's change history works. This template wires the three services over Railway's private network, generates database passwords, attaches volumes so data survives redeploys, and publishes only the Overleaf UI. After deploy, create the first admin account at /launchpad, then sign in and start a project. Set OVERLEAF_SITE_LANGUAGE if you want a UI language other than English.
Common Use Cases
- Run a private alternative to overleaf.com for yourself or a lab
- Collaborate on papers, theses, and grant proposals in the browser
- Teach LaTeX with an institutional editor that keeps documents in-house
- Compile CVs, posters, and conference abstracts without a local TeX install
Dependencies for Overleaf Hosting
- Overleaf Community Edition (
sharelatex/sharelatex:6.1.2) - MongoDB 8.0 running as a replica set
- Redis 8.2 with password authentication
- Persistent volumes for Overleaf data, MongoDB, and Redis
Deployment Dependencies
- Overleaf Community Edition
- Overleaf environment variables
- sharelatex/sharelatex Docker image
- Railway volumes
- Railway private networking
Implementation Details
- Create the first admin user at
/launchpadon your public Overleaf domain after the deployment is healthy. OVERLEAF_SITE_URLis set automatically fromRAILWAY_PUBLIC_DOMAINso links and websockets work on Railway's HTTPS domain.- Email confirmation is disabled (
EMAIL_CONFIRMATION_DISABLED=true) so local accounts work without SMTP. Add SMTP variables later if you want invite emails. OVERLEAF_SITE_LANGUAGEdefaults toen. Set it tozh-CN(or another supported locale) to change the UI language.- Community Edition is intended for trusted users. Sandboxed compiles are a Server Pro feature and are not enabled here.
- The CE image ships a default TeX Live set. Install extra packages from the Overleaf UI, or switch the image if you need a full TeX Live distribution.
- Redis and MongoDB stay on the private network. Only the Overleaf service is publicly reachable on port 80.
Why Deploy Overleaf 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 Overleaf 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.
Template Content
