MrDoc Deployment Guide
Simple Run
Deployment guide
Deploy MrDoc with Docker (recommended)
Docker image deployment
Deploy with Docker Compose
Manage Docker containers
Deploy MrDoc on Linux
Deploy MrDoc with Nginx + uWSGI
One-click deployment script (no longer maintained)
Baota Panel "Python Project Manager 1.9" deployment
Official Docker image deployment
Deploy MrDoc on Windows
Deploy with Waitress
Windows deployment panel
NAS deployment
Deploying on Zspace NAS
Feiniu FnOS deployment
Update upgrade notes - Open Source Edition
Update upgrade notes - Pro edition
System dependency library description
Migrating native deployment to Docker deployment
Configuration guide
Custom database configuration
Configure PDF generation for collections
Full-text search configuration
Using MySQL database with Docker
Configuring MySQL database to support emoji
Host static file resources with Nginx
Enable SSL with Nginx / Set up HTTPS
Configure reverse proxy/bind domain with Nginx
Nginx handling local video playback
Custom uWSGI configuration
Configuration file description
Data security
Site data backup/site migration
Professional data export and import
Open source data export and import
Data migration from open source to professional edition
Frequently asked questions
What to do if SQLite3 version error occurs?
What if the admin forgets the password?
Error: SyntaxError: invalid syntax
MySQLdb._exceptions.OperationalError: (1366, "Incorrect string value:")
Baota Panel "Python Project Manager" virtual environment usage issues.
View logs/log storage location
403 errors on POST/PUT requests for login, publish, upload, and edit under Nginx/HTTPS
What if I can't access the backend after switching the default login method?
Troubleshooting
Tip sponsorship records
MrDoc deployment server configuration recommendations
Powered by MrDoc Pro
-
+
home
Deploy MrDoc with Nginx + uWSGI
# Deploying MrDoc with Nginx + uWSGI # Deploying MrDoc on Linux with Nginx Reverse Proxy > If you are not familiar with Linux operations, do not know how to use the command line, or are not familiar with English prompts, it is recommended to read the following first: > > "Docker Deployment": https://doc.mrdoc.pro/doc/3958/ This document describes how to deploy MrDoc in a Linux environment using: * Nginx (reverse proxy) * uWSGI (running Django) * systemctl (process management) The example environment in this document: * Debian 10 * Python 3.9+ * User directory: `/home/zmister/` >i Please modify the `/home/zmister/` path in this document according to your actual environment. --- # Installing the Base Environment ## Installing the Python Virtual Environment Tool ```bash sudo apt update sudo apt install python3 python3-venv python3-pip -y ``` ## Installing Nginx ```bash sudo apt install nginx -y ``` ## Installing uWSGI It is recommended to install with pip: ```bash pip3 install uwsgi ``` After installation, you can test it: ```bash uwsgi --version ``` --- # Pulling the MrDoc Source Code Use Git to pull the source code: ```bash git clone https://gitee.com/zmister/MrDoc.git ``` Or: ```bash git clone https://github.com/zmister2016/MrDoc.git ``` After pulling, the directory structure is as follows: ```text /home/zmister/ ├── MrDoc ``` --- # Creating a Python Virtual Environment To avoid affecting the system Python environment, it is recommended to use a virtual environment. ## Creating the Virtual Environment ```bash python3 -m venv /home/zmister/mrdoc_env ``` ## Activating the Virtual Environment ```bash source /home/zmister/mrdoc_env/bin/activate ``` After successful activation, the following will appear in front of the terminal: ```bash (mrdoc_env) ``` --- # Installing MrDoc Dependencies ```bash pip install -r /home/zmister/MrDoc/requirements.txt ``` --- # Initializing the Database ## Entering the Project Directory ```bash cd /home/zmister/MrDoc ``` ## Executing Database Migration ```bash python manage.py migrate ``` ## Creating an Administrator Account ```bash python manage.py createsuperuser ``` Enter the following as prompted: * Username * Email * Password The creation is then complete. --- # Test Run Before formal deployment, it is recommended to first test whether the project can start normally: ```bash python manage.py runserver 0.0.0.0:8000 ``` Access in the browser: ```text http://server IP:8000 ``` If the MrDoc page can be opened normally, it indicates that the environment is fine. After testing is complete, press: ```text Ctrl + C ``` to stop running. --- # Creating the Deployment Directory Create a unified deployment configuration directory: ```bash mkdir /home/zmister/mrdoc_deploy ``` The directory structure is as follows: ```text /home/zmister/ ├── MrDoc ├── mrdoc_deploy └── mrdoc_env ``` --- # Configuring uWSGI Create a new configuration file in the deployment directory: ```bash nano /home/zmister/mrdoc_deploy/mrdoc_uwsgi.ini ``` Write the following content: ```ini [uwsgi] # 项目目录 chdir = /home/zmister/MrDoc # Django WSGI module = MrDoc.wsgi:application # Python 虚拟环境 virtualenv = /home/zmister/mrdoc_env # 使用 HTTP 方式监听 http = 127.0.0.1:8008 # 主进程 master = true # 工作进程数 processes = 2 # 每个进程线程数 threads = 2 # 自动清理环境 vacuum = true # 退出时自动删除 die-on-term = true # 日志 daemonize = /home/zmister/mrdoc_deploy/uwsgi.log ``` --- # Configuring the Nginx Reverse Proxy Create the Nginx configuration file: ```bash nano /home/zmister/mrdoc_deploy/mrdoc_nginx.conf ``` Write the following content: ```nginx server { listen 80; # 修改为你的域名或服务器IP server_name _; charset utf-8; # 上传大小限制 client_max_body_size 100M; access_log /var/log/nginx/mrdoc_access.log; error_log /var/log/nginx/mrdoc_error.log; # 静态文件 location /static/ { alias /home/zmister/MrDoc/static/; expires 30d; } # 用户上传文件 location /media/ { alias /home/zmister/MrDoc/media/; expires 30d; } # 反向代理到 uWSGI HTTP 服务 location / { proxy_pass http://127.0.0.1:8008; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_read_timeout 300; } } ``` --- # Creating the systemctl Service Create the service file: ```bash nano /home/zmister/mrdoc_deploy/mrdoc.service ``` Write the following content: ```ini [Unit] Description=MrDoc Service After=network.target [Service] User=zmister Group=zmister WorkingDirectory=/home/zmister/MrDoc ExecStart=/home/zmister/mrdoc_env/bin/uwsgi --ini /home/zmister/mrdoc_deploy/mrdoc_uwsgi.ini Restart=always RestartSec=5 [Install] WantedBy=multi-user.target ``` --- # Registering the systemctl Service Copy the service file: ```bash sudo cp /home/zmister/mrdoc_deploy/mrdoc.service /etc/systemd/system/ ``` Reload systemd: ```bash sudo systemctl daemon-reload ``` Set it to start on boot: ```bash sudo systemctl enable mrdoc ``` Start the service: ```bash sudo systemctl start mrdoc ``` Check the running status: ```bash sudo systemctl status mrdoc ``` --- # Configuring the Nginx Site Create a symbolic link: ```bash sudo ln -s /home/zmister/mrdoc_deploy/mrdoc_nginx.conf /etc/nginx/sites-enabled/mrdoc_nginx.conf ``` Test the Nginx configuration: ```bash sudo nginx -t ``` If it prompts: ```text test is successful ``` it indicates that the configuration is correct. Reload Nginx: ```bash sudo systemctl reload nginx ``` --- # Accessing MrDoc Now you can access it through the browser: ```text http://server IP ``` Or: ```text http://your domain ``` --- # Common Commands ## Checking MrDoc Running Status ```bash sudo systemctl status mrdoc ``` ## Restarting MrDoc ```bash sudo systemctl restart mrdoc ``` ## Stopping MrDoc ```bash sudo systemctl stop mrdoc ``` ## Checking uWSGI Logs ```bash tail -f /home/zmister/mrdoc_deploy/uwsgi.log ``` ## Checking Nginx Logs ```bash tail -f /var/log/nginx/mrdoc_error.log ``` --- # HTTPS Configuration (Recommended) It is recommended to use HTTPS in a production environment. If you already have a domain, you can use Certbot to apply for a free SSL certificate: ```bash sudo apt install certbot python3-certbot-nginx -y ``` Execute: ```bash sudo certbot --nginx ``` Follow the prompts to automatically complete the HTTPS configuration. --- # Deployment Complete At this point, you have completed: * Nginx reverse proxy * uWSGI deployment of Django * systemctl process management * Static resource configuration * HTTPS support (optional) for a complete MrDoc deployment.
mrdoc
Sept. 29, 2026, 6:34 p.m.
Forward
Favorites
Last
Next
Scan the QR Code
Copy link
Scan the QR code to share.
Copy link
share
link
type
password
Update password
Validity period
Markdown file
Word document
PDF document (print)