- Published on
Self-hosting CodiMD with company sign-in so engineers kept using it

- Authors

- Name
- Nadim Tuhin
- @nadimtuhin
On this page
At Pathao, engineers liked a hosted collaborative markdown editor. You open a note, write markdown, share the link, and your team edits it with you in real time.
I wanted to keep all of that. I only wanted to change two things: where it ran and how people signed in.
Why not just ban it
The usual move with a tool you want to leave is a policy. That's the trap: it rarely works.
People used that editor because it was the fastest way to write something down with their team. Take it away without a replacement and the docs move somewhere worse, or stop getting written at all.
So the tool was right. The hosting and the sign-in were what needed to change.
The setup and the demo
CodiMD is an open-source collaborative markdown editor. Same editing experience, same real-time collaboration, and you can run it yourself.
Here's the minimal Docker Compose setup that connects it to internal OAuth:
version: '3'
services:
database:
image: postgres:11.5-alpine
environment:
- POSTGRES_USER=codimd
- POSTGRES_PASSWORD=change-me
- POSTGRES_DB=codimd
volumes:
- database:/var/lib/postgresql/data
codimd:
image: hackmdio/codimd:2.4.2
environment:
- CMD_DB_URL=postgres://codimd:change-me@database:5432/codimd
- CMD_DOMAIN=notes.company.internal
- CMD_PROTOCOL_USESSL=true
- CMD_OAUTH2_CLIENT_ID=company-sso
- CMD_OAUTH2_CLIENT_SECRET=sso-secret
ports:
- '3000:3000'
depends_on:
- database
volumes:
database:
I set one up and showed it to our CTO. Two points made the case:
- It runs on our own infrastructure. We decide where the notes live.
- It uses the company sign-in everyone already had. No new passwords.

For engineers, the only thing that changed was the URL.
Adoption
We gave it a short internal name, so nobody had to learn a new word.
Within two months, 150+ engineers and product managers had moved over and written 1,200+ internal design docs, with 99.9% uptime. No policy drove that. It was the editor they already liked, with the login they already had.
Lessons I took from it
- Keep the tool, move where it runs. People liked the editor. Changing it would've been a fight. Changing only the hosting was easy.
- Make the safe path the easy path. With company sign-in, the controlled option was also the one-click option. Nobody had to be told twice.
- A short demo beats a long proposal. Showing the CTO a working instance settled it faster than any document would have.
- Name it. A short name made it feel like our tool, not an IT mandate.
If your team loves a hosted tool, look for the open-source version and run it yourself. Add your single sign-on, keep the same editor, and the move mostly happens on its own.
Related posts
- PathaoTalk: how we moved a whole company off Workplace Chat in a month
Workplace Chat had no markdown, snippets or integrations, and it charged per seat. Self-hosted Mattermost replaced it company-wide in about a month and cut our chat costs.
- Pathao Tickets: replacing Zendesk with a patched open source helpdesk
Pathao support ran on Zendesk. We patched an open source helpdesk for ticketing, live chat and automations at roughly a third of the Zendesk bill.
- Tailscale and Cloudflare Tunnel: my home PC with zero open ports
How I reach my home PC: Tailscale for ssh and Herdr from my own devices, Cloudflare Tunnel with Access for browser tools, and no open router ports.