Deploy ownCloud
File sync and share server with a web UI, WebDAV and sync clients
MySQL
Just deployed
/var/lib/mysql
Redis
Just deployed
/data
owncloud
Just deployed
/mnt/data
owncloud-data
Bucket
Just deployed
Deploy and Host ownCloud on Railway
Self-host ownCloud and you get the file sync and sharing layer Dropbox and Google Drive provide, on infrastructure you control. Teams keep documents in one place, sync them to desktops and phones through the official clients, hand out expiring public links, and mount the tree over WebDAV from scripts and backup tools. Because the files stay under your own credentials, it answers data-residency requirements a public cloud drive cannot.
Deploy ownCloud on Railway and the supporting stack comes with it. The owncloud service runs ownCloud Server 11 on Apache with PHP 8.3, plus its background-job daemon in the same container. MySQL stores accounts, shares, tags and file metadata. Redis carries the distributed cache and the transactional locks that stop two sync clients writing one file at once. A Railway object-storage bucket is wired in as ownCloud's primary storage, so uploads go straight to durable storage and the volume holds only configuration, sessions and installed apps.

Getting Started with ownCloud on Railway
Open the deployed URL and you land on the sign-in page. The first administrator is created during the initial boot from OWNCLOUD_ADMIN_USERNAME and OWNCLOUD_ADMIN_PASSWORD, so sign in with those rather than looking for a registration form — ownCloud has no self-registration, and later accounts are made under Settings → Users. Change the bootstrap password under Settings → Personal → Security.
The first screen is the Files app, holding the sample Documents and Photos folders. Create a folder, drag a file in, and confirm the size and thumbnail appear — that round trip proves the bucket accepts writes and serves reads back. Then hover a folder, click the share icon, open the Public Links tab and create a link; opening it in a private window shows what a recipient sees. To connect a sync client, use the deployment URL as the server address. Settings → Admin → General should read All checks passed.

About Hosting ownCloud
ownCloud is an open-source content collaboration platform under the AGPLv3. One server presents a single file tree through a web UI, WebDAV and sync clients for Windows, macOS, Linux, iOS and Android, with sharing, versioning, a trash bin, tags and add-on apps around it.
Key features:
- Desktop and mobile sync clients, plus a standards-compliant WebDAV endpoint
- Public links with expiry dates, passwords and read-only or upload rights
- Sharing with users and groups, and federated sharing between servers
- File versioning, a restorable trash bin, and per-user or per-group quotas
- LDAP and OpenID Connect authentication, and external storage mounts
The multi-service shape matters: ownCloud keeps file content separately from file metadata. MySQL owns the metadata, so it must be durable and backed up. Redis is not optional in practice — without it ownCloud falls back to database locking, which slows every concurrent write. Object storage holds the file bodies, letting the deployment grow past any single disk.
Why Deploy ownCloud on Railway
Railway removes the parts of an ownCloud install that take an afternoon.
- MySQL and Redis are provisioned, privately networked and backed up for you
- Object storage is attached as primary storage, no bucket policy to write
- HTTPS, a public domain and certificate renewal are handled at the edge
- Background jobs, the volume mount and the health check are wired up
- Scaling CPU or memory is a slider, not a migration
Common Use Cases
- A private team drive for a company that cannot put client files on a public cloud
- A hand-off point for large files, using expiring links instead of attachments
- A WebDAV target that backup scripts and CI jobs write to with ordinary credentials
- A departmental document store fronted by existing LDAP or OpenID Connect accounts
Dependencies for ownCloud
- ownCloud Server 11 — built from gridalpha/owncloud-railway on the official
owncloud/server:11.0.0image, with Apache, PHP 8.3 and the job daemon - MySQL 9.4 — accounts, shares, tags and the file metadata index
- Redis 8.2 — distributed cache and transactional file locking
- Object storage bucket — the file bodies, as ownCloud's primary storage
Environment Variables Reference
| Variable | Purpose |
|---|---|
OWNCLOUD_ADMIN_USERNAME | Login name of the administrator created on first boot |
OWNCLOUD_ADMIN_PASSWORD | That account's initial password; change it after signing in |
OWNCLOUD_TRUSTED_DOMAINS | Hostnames the server answers on; add a custom domain here |
OWNCLOUD_DB_* | Database type, host, name and the scoped account ownCloud uses |
OWNCLOUD_REDIS_* | Cache and locking backend connection details |
OWNCLOUD_OBJECTSTORE_* | Bucket, endpoint, region and keys for primary storage |
OWNCLOUD_MAX_UPLOAD | Largest single upload accepted, 20G by default |
OWNCLOUD_MAIL_SMTP_* | Add these for notification and password-reset email |
Deployment Dependencies
- Source repository:
- Upstream server:
- Official image:
- Admin manual:
Hardware Requirements for Self-Hosting ownCloud
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2+ vCPU for concurrent sync clients |
| RAM | 1 GB | 2–4 GB with Redis and previews on |
| Storage | 5 GB volume | 5 GB volume plus object storage |
| Runtime | PHP 8.3, Apache | PHP 8.3, Apache, MySQL 9, Redis 8 |
The volume holds only configuration, sessions and installed apps, so it stays small however much is uploaded. Plan capacity around the bucket.
Self-Hosting ownCloud
Outside Railway this is Docker Compose with a database and a cache. The image reads its configuration from environment variables, so an evaluation instance is one command:
docker run --rm --name owncloud -d -p 8080:8080 owncloud/server:11.0.0
That uses SQLite, which upstream does not support in production. A realistic stack pairs the server with MariaDB and Redis:
services:
owncloud:
image: owncloud/server:11.0.0
ports: ["8080:8080"]
environment:
- OWNCLOUD_TRUSTED_DOMAINS=cloud.example.com
- OWNCLOUD_DB_TYPE=mysql
- OWNCLOUD_DB_HOST=mariadb
- OWNCLOUD_DB_NAME=owncloud
- OWNCLOUD_DB_USERNAME=owncloud
- OWNCLOUD_DB_PASSWORD=change-me
- OWNCLOUD_REDIS_ENABLED=true
- OWNCLOUD_REDIS_HOST=redis
volumes: ["oc:/mnt/data"]
mariadb:
image: mariadb:10.11
environment: ["MYSQL_ROOT_PASSWORD=change-me", "MYSQL_DATABASE=owncloud"]
redis:
image: redis:8
volumes: { oc: }
Pin an explicit version rather than latest: that tag does not track the newest ownCloud Classic release, and a floating tag lets a container restart decide when a major upgrade happens.
Is ownCloud Free to Self-Host?
The community edition is free and open source under the AGPLv3, with no user limit and no feature gate on sharing or sync. An Enterprise Edition adds paid extras such as advanced auditing and vendor support, unlocked by a licence key bought separately. On Railway you pay only for the compute, database, volume and object storage used.
FAQ
What is ownCloud? ownCloud is an open-source file sync and share server. It gives a team a private drive reachable from a browser, sync clients and WebDAV, with sharing, versioning and quotas managed by an administrator.
What does this Railway template deploy? Four pieces: ownCloud Server 11 on Apache and PHP 8.3, a MySQL database, a Redis instance, and an object-storage bucket set as primary file storage. The app runs its own background-job daemon, so scheduled tasks need no second service.
Why does the template include MySQL and Redis? ownCloud keeps file metadata — accounts, shares, tags, the file index — in a relational database, and MySQL is upstream's recommended engine. Redis provides the distributed cache and the file locks that stop two sync clients corrupting the same file.
Where are my uploaded files actually stored? In the attached object-storage bucket, not on the volume. ownCloud writes file bodies as opaque objects and keeps their names and structure in MySQL.
How do I add a custom domain to a self-hosted ownCloud?
Attach the domain in Railway, then add its hostname to OWNCLOUD_TRUSTED_DOMAINS beside the existing comma-separated values. ownCloud rejects any request whose Host is not on that list, so an unlisted domain returns an error rather than the login page.
What is the difference between ownCloud and Nextcloud? Nextcloud is a 2016 fork of ownCloud with a broader bundled feature set, including calendar, contacts and chat. ownCloud Classic stayed closer to file sync and share, and its Infinite Scale product is a separate Go rewrite. For a focused file server rather than a groupware suite, ownCloud Classic is the smaller thing to operate.
Template Content