Deploy Nextcloud

Self-hosted file sync, sharing and collaboration with Postgres and Redis

Deploy Nextcloud

/var/lib/postgresql/data

Just deployed

/data

/var/www/html

Deploy and Host Nextcloud on Railway

Nextcloud is an open-source platform for file sync and sharing, calendars, contacts and team collaboration that you run on your own server. Desktop and mobile clients keep files in sync, a web interface handles sharing and editing, and hundreds of apps add features such as notes, tasks and video calls.

About Hosting Nextcloud

Hosting Nextcloud means running a PHP web application, a database, a cache and a scheduler, and keeping all of them configured to work together. You need persistent storage for user files, configuration and installed apps, HTTPS with the right trusted domains and proxy settings, file locking through Redis, and background jobs every few minutes. Upgrades must move one major version at a time, and the database needs occasional index updates. This template does that wiring for you: Nextcloud installs itself on the first start with a generated admin password, sets the Railway domain, runs background jobs by cron and applies upgrades when the image is updated.

Common Use Cases

  • Private file storage and sync across desktop and phone, as an alternative to Google Drive, Dropbox or OneDrive
  • Sharing files and folders with family, clients or a team through links with passwords and expiry dates
  • Shared calendars, contacts and tasks through CalDAV and CardDAV, plus collaboration apps from the Nextcloud app store

Dependencies for Nextcloud Hosting

  • PostgreSQL (Railway's Postgres service) for metadata, users and shares
  • Redis (Railway's Redis service) for file locking, caching and sessions

Deployment Dependencies

Implementation Details

  • Version: Nextcloud 35.0.3 (official nextcloud:35.0.3-apache image, pinned by digest). Updates come as changes to the template repo, and Railway offers them to you as an update you can apply.
  • Log in with the user admin and the password in the NEXTCLOUD_ADMIN_PASSWORD variable of the Nextcloud service. Change the password in Nextcloud afterwards: the variable is only used on the first start.
  • All data (files, config, apps) lives on the volume mounted at /var/www/html. Back up that volume and the Postgres database before a major upgrade.
  • Own domain: add it in Railway's networking settings, then set NEXTCLOUD_TRUSTED_DOMAINS on the Nextcloud service to a space-separated list such as cloud.YOUR-DOMAIN nextcloud-xxxx.up.railway.app, and OVERWRITECLIURL to https://cloud.YOUR-DOMAIN.
  • Email is optional: set it in Nextcloud under Administration settings, Basic settings, or with the image's SMTP_* variables.
  • Health check: /healthz answers only when Nextcloud is installed, not in maintenance mode, and the database responds.

Why Deploy Nextcloud 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 Nextcloud 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

More templates in this category

View Template
RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set
S3-compatible object store, keys and public URL preset, volume kept

SuperSlowSloth
0
View Template
TimescaleDB
A PostgreSQL-based time-series database for analytics on Railway.

Rakit
1
View Template
NEW
Neo4j 2026.10 Community
Neo4j graph database with APOC, Browser, Bolt TCP proxy and a volume

My Projects
0