What is MkDocs
MkDocs is a modern, fast, and lightweight static site generator designed for creating project documentation.
It allows you to write your content in Markdown and build a full-featured website with just a few commands.
Whether you're documenting an open-source project or creating internal manuals, MkDocs makes the process smooth and efficient.
βοΈ Installation on Windows & Linux
Follow the steps below to install MkDocs on your computer. You only need a working Python environment and internet connection.
- Download the latest version of Python from python.org
- Run the installer. IMPORTANT: Make sure to check the box "Add Python to PATH"
- Open the Command Prompt:
- Press
Windows + R
- Type
cmd
and press Enter
- Press
- Check if Python is installed:
Type:
python --version
If successful, it will return a version likePython 3.11.5
- Install MkDocs using pip:
pip install mkdocs
- Verify MkDocs installation:
mkdocs --version
You should see the version of MkDocs installed.
Note
If Python is not recognized, try reinstalling it and ensure "Add to PATH" is checked during setup.
- Update your package manager (recommended):
sudo apt update
- Install Python and pip (Pythonβs package manager):
sudo apt install python3 python3-pip
- Check your Python version:
python3 --version
It should display something likePython 3.10.12
- Install MkDocs:
pip3 install mkdocs
- Verify installation:
mkdocs --version
If successful, the installed version will appear.
Note
You may need to use python3
and pip3
instead of python
and pip
on Linux.
π§ Basic MkDocs Commands
Here are some essential MkDocs commands youβll use regularly:
mkdocs new "project_name"
β Create a new MkDocs project foldermkdocs serve
β Start a live preview server atlocalhost:8000
mkdocs build
β Build the static site into thesite/
foldermkdocs --version
β Display the installed version of MkDocs
π¨ Common Installation Issues
β Problem: 'python' is not recognized as an internal or external command
β
Solution:
This usually means Python wasn't added to your system PATH.
Reinstall Python and make sure to check "Add Python to PATH" during installation.
With MkDocs installed, you're now ready to start building beautiful documentation sites with just Markdown and a few commands. π