Published on

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

Self-hosting CodiMD with company sign-in so engineers kept using it
Authors
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.
Diagram of the setup: engineers open CodiMD, run on our own infrastructure, and sign in with the company login they already had

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.