Installation
Prerequisites
Section titled “Prerequisites”- Node.js 24 or later
- Basic comfort with the command line
Choose Your Path
Section titled “Choose Your Path”The recommended way to run MikroChat in production. A single command installs the mikrochat CLI, which handles downloading, configuring, and running MikroChat.
-
Install the CLI
Terminal window curl -sSL https://releases.mikrochat.com/install.sh | bashThis creates the
mikrochatcommand in~/.local/bin/. -
Download MikroChat
Terminal window mikrochat installDownloads the latest release to
~/.mikrochat/. -
Initialize a project
Create a directory for your deployment and initialize it:
Terminal window mkdir my-chat && cd my-chatmikrochat initThis creates
mikrochat.config.jsonand copies the web app to./app/. -
Configure
Edit
mikrochat.config.jsonwith your settings. An example configuration to set up MikroChat with password-based sign-in and allowing new users to enter could look like this:{"auth": {"authMode": "dev","jwtSecret": "CHANGE-ME-use-a-random-string-at-least-32-characters","appUrl": "http://localhost:8000","isInviteRequired": false},"chat": {"initialUser": {"userName": "admin","email": "admin@yourdomain.com"}},"server": {"allowedDomains": ["*"]}} -
Start the API
Terminal window mikrochat startThe API starts on
http://localhost:3000. -
Serve the frontend
Point your web server at the
./app/directory. For example, with Caddy:localhost:8000 {root * /path/to/my-chat/appfile_servertry_files {path} /index.html}Or for a quick test, use any static file server:
Terminal window npx http-server -p 8000 ./app -
Sign in
Open
http://localhost:8000in your browser and sign in with your configured initial user’s email.
CLI Commands
Section titled “CLI Commands”| Command | Description |
|---|---|
mikrochat install | Download and install MikroChat |
mikrochat init | Create config file and copy web app to current directory |
mikrochat start | Start the MikroChat API server |
mikrochat upgrade | Upgrade to the latest version |
mikrochat version | Show installed version |
mikrochat uninstall | Remove MikroChat from your system |
See the CLI Reference for full details.
Download the latest release and deploy the parts separately. Good for custom setups, Docker, or when you want full control over the deployment.
-
Download the release
Download and extract the latest release:
Terminal window curl -sSL -o mikrochat.zip https://releases.mikrochat.com/mikrochat_latest.zipunzip mikrochat.zipThe archive contains:
mikrochat/├── api/mikrochat.mjs # Backend API (run with Node.js)├── app/ # Frontend web app (static files)├── VERSION├── LICENSE├── README.md├── sbom.json└── oss-licenses.txt -
Deploy the frontend
Upload the
app/directory to any static hosting:- Your own web server (Caddy, nginx, Apache)
- Netlify, Vercel, Cloudflare Pages
- AWS S3 + CloudFront
-
Deploy the API
Copy
api/mikrochat.mjsto your server, createmikrochat.config.jsonin the same directory, and run:Terminal window node mikrochat.mjsSee the Deployment guide for systemd, Docker, and PM2 examples.
-
Sign in
Open your frontend URL and sign in with your configured initial user’s email.
Clone the repository and work from source. Use this when you want to contribute or customize MikroChat.
-
Clone and install
Terminal window git clone https://github.com/mikaelvesavuori/mikrochat.gitcd mikrochatnpm install -
Create the configuration file
Terminal window cp mikrochat.config.example.json mikrochat.config.jsonAt minimum, configure your initial user:
{"auth": {"authMode": "dev","jwtSecret": "my-secret-super-random-key","appUrl": "http://localhost:8000","isInviteRequired": false},"chat": {"initialUser": {"userName": "admin","email": "admin@example.com"}},"server": {"allowedDomains": ["*"]}} -
Start the frontend server
In a terminal, start the static file server:
Terminal window npm run devThis serves the web application on
http://localhost:8000. Leave this running. -
Start the backend
In a second terminal, build and start the API:
Terminal window npm run dev:reloadThis compiles the frontend JavaScript and starts the backend on
http://localhost:3000. -
Sign in
Open
http://localhost:8000in your browser. Enter the email address from your configuration to sign in.In dev mode, no email is sent — you’re signed in immediately.
Development Notes
Section titled “Development Notes”The compiled frontend JavaScript (mikrochat.min.js) is placed in the app directory. Don’t edit this file directly.
Clearing Stale Data
Section titled “Clearing Stale Data”During development, you may need to clear cached or stale data:
# Clear the databaserm -rf mikrochat_db
# Clear service workers (in browser console)navigator.serviceWorker.getRegistrations().then(rs => rs.forEach(r => r.unregister()))
# Clear localStorage (in browser console)localStorage.clear()Build for Production
Section titled “Build for Production”Build both frontend and backend:
npm run buildThis creates:
dist/— optimized static files for the web applicationlib/— bundled backend in ESM format
See the Deployment guide for production setup.
Next Steps
Section titled “Next Steps”- Configuration — All configuration options explained
- Authentication — Dev mode, magic link, password, and OAuth 2.0
- User Management — Adding and managing users
- Deployment — Production deployment guide
- CLI Reference — CLI and server options
- API Reference — HTTP API endpoints