---
title: "Deploy Nextcloud | (Just Updated) Google Drive Alternative Whose Background Jobs Actually Run"
description: "Google Drive alternative whose background jobs and login throttle work"
category: "Storage"
url: https://railway.com/deploy/nextcloud-or-just-updated-google-drive-a
---

# Deploy Nextcloud | (Just Updated) Google Drive Alternative Whose Background Jobs Actually Run

Google Drive alternative whose background jobs and login throttle work

**[Deploy Nextcloud | (Just Updated) Google Drive Alternative Whose Background Jobs Actually Run on Railway](https://railway.com/template/nextcloud-or-just-updated-google-drive-a)**

- **Creator:** SuperSlowSloth
- **Category:** Storage

## Template content

### nextcloud

- **Image:** ghcr.io/bon5co/nextcloud-railway:34.0.2
- **Public domain:** Yes

### postgres

- **Image:** postgres:17.10-alpine

### redis

- **Image:** redis:7.4-alpine

## Documentation

# Deploy and Host Nextcloud on Railway

Nextcloud is a self-hosted file sync and collaboration platform — a private alternative to Google
Drive, Dropbox and Microsoft 365. Files sync to desktop and mobile clients over WebDAV, and the
same instance carries calendars, contacts, shared links, Nextcloud Talk and 300+ apps from its own
app store.

This deployment runs Nextcloud 34.0.2 on a volume with Postgres and Redis, and it fixes the three
things that decide whether a Nextcloud on a redeploying platform behaves: the background job
runner, the client IP behind the edge proxy, and the admin account.

## About Hosting Nextcloud

Hosting Nextcloud means running a PHP application that keeps user data on disk, a database for
metadata, and a scheduler for the work that happens when nobody is looking. On Railway three
details matter more than they do on a VPS:

- **Background jobs.** A fresh install runs them in `ajax` mode — one job per page load. An
  instance driven by sync clients and WebDAV loads no pages, so trash and version expiry, share
  expiry, preview generation, activity mail and app updates never run. This deployment switches to
  `cron` mode and runs `cron.php` inside the app container every five minutes, so no second
  always-on service is billed for it.
- **The client address.** The container's peer is always the platform edge, so Nextcloud's
  brute-force protection collapses onto a single bucket. Measured on the stock image: eight failed
  logins from eight different clients recorded **0** attempts against each client and **8** against
  the proxy, with a 25-second delay applied to that one shared bucket — i.e. one attacker slows the
  login page for everybody and is never singled out. Here the client address is recovered from the
  first `X-Forwarded-For` hop, and the same probe records one attempt per client and none against
  the proxy.
- **The admin account.** It is created here from a generated secret before the URL serves a
  request, and re-applied on every boot, so rotating it is a redeploy rather than a support
  ticket.

The image is pinned to 34.0.2. Nextcloud only upgrades one major at a time and refuses to start
when the data directory is more than one major behind — on a tag that floats, a redeploy is an
unrequested upgrade and a long-idle instance is a container that will not boot.

## Common Use Cases

- Private cloud storage and file sharing for a person or a small team, synced to desktop and phone
- Photo and video backup from mobile devices, with albums, tagging and shared links
- Calendars, contacts and tasks over CalDAV/CardDAV, kept off third-party servers
- A data-sovereignty-compliant document store for teams that cannot use US-hosted SaaS

## Dependencies for Nextcloud Hosting

- Nextcloud 34.0.2 (Apache + PHP 8.5) — `ghcr.io/bon5co/nextcloud-railway:34.0.2`, a thin wrapper
  on the official `nextcloud:34.0.2-apache`
- PostgreSQL 17 — users, file metadata, shares and app configuration
- Redis 7 — distributed cache and transactional file locking

### Deployment Dependencies

- [Nextcloud documentation](https://docs.nextcloud.com/server/stable/admin_manual/)
- [Official Nextcloud image](https://hub.docker.com/_/nextcloud)
- [Wrapper image source](https://github.com/bon5co/nextcloud-railway)

### Implementation Details

Volumes: `/var/www/html` on the app (config, apps and user data under `data/`) and
`/var/lib/postgresql` on the database. Both are required — Nextcloud keeps uploaded files on disk,
not in the database.

The deploy form asks for nothing. `NEXTCLOUD_ADMIN_PASSWORD` is generated per deploy, the database
credentials are wired between services, and `NEXTCLOUD_TRUSTED_DOMAINS`, `overwritehost`,
`overwriteprotocol` and `overwrite.cli.url` are derived from the Railway domain so share links and
client setup payloads are `https://` and correct.

Sizing follows the plan: PHP's `memory_limit` and OPcache, and Apache's `MaxRequestWorkers`, are
computed from the container's cgroup limits instead of the image's fixed 512M / 150 workers.

First boot installs the schema and the bundled apps and takes a few minutes; there is deliberately
no HTTP healthcheck so that install cannot be killed halfway.

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


## Similar templates

- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.
- [Redis](https://railway.com/deploy/redis-1) — Self Host Latest Redis with Railway
- [EasyImg](https://railway.com/deploy/easyimg) — Simple self-hostable Nuxt.js personal image hosting system.

Open this page in a browser: https://railway.com/deploy/nextcloud-or-just-updated-google-drive-a
