# Self-host the open-source editors

Source: https://mroffice.ai/en/developers/open-source/self-hosting

Build and run MR Office's open-source editors yourself: clone, build and serve the playground as static files, or run the open desktop shell.

## Build and run

Node.js 20.19 or newer. The six editors live in packages/ and run together in apps/playground.

```bash
git clone https://github.com/XinaTian/MROffice.git
cd MROffice
npm install
npm run fonts     # the open substitutes for Office's fonts
npm run build
npm run preview   # http://localhost:5178
```

npm run dev starts a development server at the same address; npm run smoke checks a build.

## Serve it

The build is static files: any web server or CDN serves it. Cache the hashed scripts, styles and fonts for a year.

```nginx
# any static host serves the build: apps/playground/dist
npm run build
npx serve apps/playground/dist -l 8080

# or with nginx
server {
  listen 80;
  root /srv/mroffice/apps/playground/dist;
  location / { try_files $uri $uri/ /index.html; }
  location ~* \.(js|css|woff2|wasm)$ { add_header Cache-Control "public, max-age=31536000, immutable"; }
}
```

## Desktop shell

apps/desktop holds the source of the MR Office desktop app's shell (Electron). On its own it runs the open-source editors; with the free MR Office component from Releases it is the full desktop app, with Word, Excel, PowerPoint and PDF files.

```bash
npm run desktop            # the open desktop shell (Electron) with the editors
npm run desktop:package    # an installable build for this computer
```

## Word, Excel and PowerPoint files

Opening and saving .docx, .xlsx and .pptx, calculated formulas with functions, charts, SmartArt editing and saving PDF edits back into the file are not in the open-source build. Embed MR Office's hosted editors (Embed editors) or use the free desktop app for them.
