Deploy ONLYOFFICE Docs: Self-Hosted Document Server & Office Editor

Edit Word, Excel and PowerPoint files together in your own web apps.

Deploy ONLYOFFICE Docs: Self-Hosted Document Server & Office Editor

Just deployed

/mnt/onlyoffice

Deploy and Host ONLYOFFICE Docs on Railway

ONLYOFFICE logo

ONLYOFFICE Docs is an open source online office suite and document server. It gives your web apps browser-based editors for text documents, spreadsheets, presentations and PDFs, with strong compatibility with Microsoft Word, Excel and PowerPoint formats, real-time co-editing, comments, track changes and version history. You connect it to a host app such as Nextcloud, ownCloud, Seafile, Moodle or your own software, and that app stores the files while ONLYOFFICE handles editing. The Community Edition is AGPL-3.0 licensed, the DocumentServer repository has about 7,100 GitHub stars, and v10.0 shipped in October 2026. This template runs the official image on Railway with JWT signing turned on, a stable generated secret, and a persistent volume for the document cache. Microsoft 365 Business Standard costs about $14 per user per month. ONLYOFFICE Docs on Railway costs about $15–25/month for the server.


What This Template Deploys

ServicePurpose
ONLYOFFICE DocsThe official onlyoffice/documentserver Community Edition image with a small Railway layer, nginx on port 80 with a public domain. Editors, conversion service and API. Health check on /healthcheck.
Persistent VolumeMounted at /mnt/onlyoffice. Holds the document cache for files being edited, signing keys and runtime settings, and an optional fonts folder for your own fonts.

The Community Edition keeps co-editing state in memory, so no database, RabbitMQ or Redis service is needed. Keep it at one replica.


About Hosting ONLYOFFICE Docs

Teams that self-host their files with Nextcloud or similar tools still want to open a spreadsheet in the browser and edit it together, the way they would in Microsoft 365 or Google Docs. ONLYOFFICE Docs adds that editing layer, while your files stay in your own storage.

Document editor. Rich text editing with styles, tables, images, footnotes, tables of contents, mail merge, track changes and comparison, saved as DOCX or ODT.

Spreadsheet editor. Formulas, pivot tables, charts, conditional formatting, filters, data validation and macros, saved as XLSX or ODS.

Presentation editor. Slides with transitions, animations, themes and presenter view, saved as PPTX or ODP.

PDF editor and forms. Edit PDFs, annotate them, and build fillable forms that others fill in from a link.

Co-editing. Fast and strict co-editing modes, comments with mentions, track changes, version history and built-in chat.

Plugins and macros. Add plugins such as translators and AI helpers, and automate work with JavaScript macros.

Format fidelity. Office Open XML is the native format, so DOCX, XLSX and PPTX files keep their layout when they go back to Microsoft Office users.


Deploy ONLYOFFICE Docs in Under 5 Minutes

  1. Click Deploy on Railway. The JWT secret and link-signing secret are generated for you.
  2. Wait for the first boot, which builds the font list and can take several minutes.
  3. Open the public domain; the welcome page confirms the server is running.
  4. Copy JWT_SECRET from the service's Variables tab.
  5. In your host app, for example the Nextcloud ONLYOFFICE connector, enter your Railway URL and the same secret, then open a document.

Common Use Cases

  • Nextcloud and ownCloud: add Office-style editing to your self-hosted cloud storage.
  • Learning platforms: let students and teachers edit assignments inside Moodle.
  • Document management: open files in place from Seafile, Alfresco or similar systems.
  • Custom SaaS apps: embed document, spreadsheet and slide editors through the Docs API.
  • Microsoft 365 replacement: keep everyday Office editing without per-user licenses.
  • Data residency: process sensitive documents only on infrastructure you control.
  • Fillable forms: create PDF forms for HR, sales or customer onboarding.
  • Wiki and intranet editing: connect it to an intranet so staff edit attached files in the browser.

Configuration

VariableRequiredDefaultDescription
JWT_SECRET🔐 Auto-generated64-char secretShared with your host app; signs every request
JWT_ENABLEDRequiredtrueRejects unsigned requests; keep it on
SECURE_LINK_SECRET🔐 Auto-generated48-char secretSigns download links for cached files
ALLOW_PRIVATE_IP_ADDRESSOptionaltrueLets it fetch files from host apps on Railway's private network
ALLOW_META_IP_ADDRESSOptionalfalseBlocks cloud metadata addresses
EXAMPLE_ENABLEDOptionalfalseTurns on the unauthenticated test page at /example/
PLUGINS_ENABLEDOptionaltrueEditor plugins and macros
WOPI_ENABLEDOptionalfalseWOPI support for WOPI-based hosts
GENERATE_FONTSOptionaltrueRebuilds the font list on boot

Keep the secret stable. If JWT_SECRET changed on every boot, every integration would break after a redeploy. The template generates it once; give the same value to your host app.

Testing without a host app. Set EXAMPLE_ENABLED=true to open a simple document manager at /example/, check that editing works, then set it back to false, because anyone with the URL can upload files there.

Custom fonts. Put font files in a fonts folder on the volume and redeploy; they are copied into the server's font directory.

Connecting over the private network. If your host app also runs on Railway, ONLYOFFICE can fetch and save files through its railway.internal address, which keeps traffic private.

Memory. Since 9.4 the server runs as a single process, but it uses more memory as more documents are open, and fonts plus the conversion service add to the baseline. Plan for 1–2 GB for a small team and raise the service's memory as usage grows.

Document conversion. The same server converts between formats, for example DOCX to PDF or XLSX to CSV, through its conversion API, which host apps use for previews and exports.


Community Edition vs. Enterprise

Since version 9.4 the free Community Edition has no limit on simultaneous editing connections; the old 20-connection cap is gone. It runs as a single instance, so one server handles every editing session. Organizations that need clustering across several servers, extra administration features or official support can move to the paid Enterprise Edition from ONLYOFFICE. The AGPL-3.0 license now carries extra terms: modified versions must keep ONLYOFFICE's attribution and an About section naming it as the original developer.


ONLYOFFICE Docs vs. Alternatives

FeatureONLYOFFICE on RailwayMicrosoft 365Google WorkspaceCollabora Online
HostingSelf-hostedHosted SaaSHosted SaaSSelf-hosted
LicenseAGPL-3.0ProprietaryProprietaryMPL-2.0
Native DOCX, XLSX, PPTX✅✅ConvertsConverts from ODF
Real-time co-editing✅✅✅✅
Embed in your own app✅Limited❌✅
PDF forms✅✅❌❌
PriceAbout $15–25/month serverAbout $14/user/monthAbout $14/user/monthHosting cost

Microsoft 365 and Google Workspace bundle mail and storage. Collabora is built on LibreOffice and centers on ODF. ONLYOFFICE is the closest match to Microsoft Office formats on your own server.


Dependencies for ONLYOFFICE Docs Hosting

  • A Railway account.
  • A host app that stores files, such as Nextcloud, ownCloud, Seafile or your own integration.

Deployment Dependencies

Implementation Details

The image follows the latest tag, so a redeploy can move to a new release; v10.0 is current. The layer points the cache and data folders at the single volume, fixes their ownership and caps nginx connections to the container's limits. Edits are flushed on shutdown during a 60-second draining window.


Frequently Asked Questions

What is ONLYOFFICE Docs? An AGPL-3.0 online office suite that adds document, spreadsheet, presentation and PDF editors to other web apps.

How much does it cost to host ONLYOFFICE Docs? About $15–25/month on Railway, depending on memory, with no per-user fees.

Does it have its own login or file storage? No. A host app such as Nextcloud handles users and files; ONLYOFFICE edits them.

How do I connect Nextcloud? Install the ONLYOFFICE app in Nextcloud, then enter your Railway URL and JWT_SECRET.

How many people can edit at once? There is no connection cap in the Community Edition since 9.4; the server's memory is the practical limit.

Is my server open to anyone? No. With JWT on, only apps holding your secret can open documents.


Why Deploy and Host ONLYOFFICE Docs 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 ONLYOFFICE Docs on Railway, you get Office-compatible editors with real-time co-editing for your own apps, without per-user licenses.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
51
View Template
Foundry Virtual Tabletop
Self-hosted virtual tabletop for role-playing games (license required)

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
52