---
title: "Deploy Nextcloud"
description: "Self-hosted Google Drive, OneDrive & Dropbox alternative for file storage"
category: "Storage"
url: https://railway.com/deploy/nextcloud-complete-setup
---

# Deploy Nextcloud

Self-hosted Google Drive, OneDrive & Dropbox alternative for file storage

**[Deploy Nextcloud on Railway](https://railway.com/template/nextcloud-complete-setup)**

- **Creator:** codestorm
- **Category:** Storage
- **Total deploys:** 2

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### Nextcloud https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/nextcloud-white.svg

- **Image:** nextcloud:latest
- **Public domain:** Yes

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2.1
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

## Buckets

- **Bucket**

## Documentation

# Deploy and Host Nextcloud Complete Setup on Railway

![Nextcloud](https://raw.githubusercontent.com/nextcloud/screenshots/master/nextcloud-hub-25-files.png)

Nextcloud Complete Setup is a production-ready self-hosted cloud platform. It gives you full control over your files, real-time collaboration, calendar, contacts, and team communication — without relying on Google or Microsoft.

## About Hosting Nextcloud Complete Setup

This template deploys a complete and production-oriented Nextcloud stack on Railway using the official **`nextcloud:latest`** image. It includes:

- **Nextcloud** (`nextcloud:latest`)
- **PostgreSQL** as the main database
- **Redis** for file locking and caching
- **Railway Bucket** as primary S3-compatible object storage

All complex configurations (database connection, Redis, S3 storage, trusted domains, reverse proxy settings, etc.) are already pre-configured using Railway variable references.  

**You only need to fill in two variables to deploy:**

- `NEXTCLOUD_ADMIN_USER`
- `NEXTCLOUD_ADMIN_PASSWORD`

No need to manually configure database, Redis, storage, or domain settings.

## Common Use Cases

- Personal private cloud as a Google Drive / OneDrive replacement
- Small team or company internal file sharing and collaboration
- Secure document storage with full data ownership and control

### Why This Template?

| Feature                        | Nextcloud Complete Setup      | Google Drive          | OneDrive              | Dropbox               |
|--------------------------------|-------------------------------|-----------------------|-----------------------|-----------------------|
| Full data ownership            | ✅                            | ❌                    | ❌                    | ❌                    |
| No vendor lock-in              | ✅                            | ❌                    | ❌                    | ❌                    |
| Self-hosted / on-premise       | ✅                            | ❌                    | ❌                    | ❌                    |
| Open Source                    | ✅                            | ❌                    | ❌                    | ❌                    |
| Real-time collaboration        | ✅                            | ✅                    | ✅                    | ✅                    |
| File sync (desktop & mobile)   | ✅                            | ✅                    | ✅                    | ✅                    |
| Calendar & Contacts            | ✅                            | ✅                    | ✅                    | Limited               |
| Extensible with apps           | ✅                            | Limited               | Limited               | Limited               |
| Storage location control       | ✅ (Railway Bucket)           | Google servers        | Microsoft servers     | Dropbox servers       |
| Privacy (no scanning/ads)      | ✅                            | ❌                    | ❌                    | ❌                    |


**Key advantages of this template:**
- Uses the official `nextcloud:latest` image
- Separates concerns (App + Postgres + Redis + Storage) for better maintainability
- Railway Bucket as primary storage → more scalable than local volume only
- Extremely simple to deploy — just set admin username & password

## Dependencies for Nextcloud Complete Setup Hosting

- Nextcloud (`nextcloud:latest`)
- PostgreSQL
- Redis
- Railway Bucket (S3)

### Deployment Dependencies
- [Official Nextcloud Docker Image](https://hub.docker.com/_/nextcloud)
- [Nextcloud Documentation](https://docs.nextcloud.com)

## Why Deploy Nextcloud Complete Setup 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 Complete Setup 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-complete-setup
