Skip to main content
50% off all plans, limited time. Starting at $2.48/mo
MkDocs

MkDocs

MkDocs turns a folder of Markdown into a documentation site from one YAML config file. It ships a live-reload dev server and builds plain static HTML you can host anywhere. BSD-2-Clause licensed with 22,300+ GitHub stars.

At a glance

License BSD-2-Clause Version Latest OS Ubuntu Server 24.04 LTS Min RAM 1 GB IP IPV4,IPV6

Access

  • Open: http://SERVER_IP

Edit & Publish Content

1. Add or edit Markdown files: /opt/mkdocs/docs

2. If you add or rename pages, update /opt/mkdocs/mkdocs.yml for navigation.

3. Rebuild the site:

/opt/mkdocs/venv/bin/mkdocs build --clean \
  --config-file /opt/mkdocs/mkdocs.yml \
  --site-dir /opt/mkdocs/site

Nginx serves the generated files from: /opt/mkdocs/site

No Nginx restart is required after rebuilding.

Important Paths

  • Project: /opt/mkdocs
  • Content: /opt/mkdocs/docs
  • Configuration: /opt/mkdocs/mkdocs.yml
  • Build output: /opt/mkdocs/site
  • Python virtual environment: /opt/mkdocs/venv
  • MkDocs executable: /opt/mkdocs/venv/bin/mkdocs
  • Nginx configuration: /etc/nginx/sites-available/mkdocs.conf

Domain & HTTPS

1. Point your domain to the server's IP address.

2. Edit Nginx config and replace server_name _; with your domain (e.g., server_name <YOUR_DOMAIN>;):

vim /etc/nginx/sites-available/mkdocs.conf

3. Test the configuration:

nginx -t

4. Install Certbot:

apt install -y certbot python3-certbot-nginx

5. Generate a Let's Encrypt certificate:

certbot --nginx --non-interactive --agree-tos --email <YOUR_EMAIL> -d <YOUR_DOMAIN>

6. Reload Nginx:

systemctl reload nginx

7. Update the MkDocs site URL: replace site_url: 'http://<SERVER_IP>/' with site_url: 'https://<YOUR_DOMAIN>/' in /opt/mkdocs/mkdocs.yml.

8. Rebuild the site:

/opt/mkdocs/venv/bin/mkdocs build --clean \
  --config-file /opt/mkdocs/mkdocs.yml \
  --site-dir /opt/mkdocs/site

9. Open your browser and visit: https://<YOUR_DOMAIN>

Notes

  • Markdown changes must be rebuilt before they appear on the public website.
  • Nginx serves the generated files from /opt/mkdocs/site.
  • Change mkdocs.yml and the project configuration based on your preferences.

More in Development Tools

Related apps.

Deploy MkDocs now. From $2.48/mo.