安装

Installation

#System Requirements

This guide assumes you are using a personal computer, VPS or a bare-metal server. You also need to be on a *nix system, so any Linux Distribution and macOS is supported. If you're a Windows user, you could use Ubuntu in WSL. We officially support only the following distributions.

  1. macOS
  2. Debian / Ubuntu

Learn more about the architecture here.

#Pre-requisites

Dependency Frappe v14/v15 Frappe v16/develop
MariaDB 10.6.6+ 11.8
Python 3.10+ 3.14
NodeJS 18+ 24
Redis / valkey 6 6+
Yarn 1.12+ 1.22+
pip 20+ 25.3+
  • wkhtmltopdf: version 0.12.6 with patched qt - for pdf generation
  • cron: bench's scheduled jobs - automated certificate renewal, scheduled backups

#macOS

...

#Debian(13.04) / Ubuntu(不习惯)

[!NOTE] TIPS
安装需要科学上网环境,自备梯子
设置当前窗口的临时代理

export ALL_PROXY="172.22.152.1:7890"

自行安装 Debian13
安装时新增用户名设为 frappe
只安装ssh server 和 基础工具 其他默认(简体中文、中国),root 和 frappe 密码自定义

系统安装完毕后

ip a
apt install vim -y
vim /etc/ssh/sshd_config
PermitRootLogin yes
PasswordAuthentication yes
systemctl restart ssh

加固建议:限制 IP 访问、秘钥验证、安装 Fail2Ban、定期更新系统

远程连接用 frappe 登录,授权 sudo 权限

su -

apt update
apt install sudo

usermod -aG sudo frappe

su - frappe

初始系统安装完成


You should be running Debian 13+ or Ubuntu 24.04+, otherwise you may have issues with some of the packages.
(高版本对于 wkhtmltopdf 不兼容其实)

Update your system's package index

sudo apt update #略

Install git, redis, and mariadb...

sudo apt install git redis-server libmariadb-dev mariadb-server mariadb-client pkg-config build-essential

During this installation you'll be prompted to set the MySQL root password. If you are not prompted, you'll have to initialize the MySQL server setup yourself. You can do that by running the command:

sudo mariadb-secure-installation #无 n 即默认
[sudo] frappe 的密码:
...

Enter root user password or leave blank:  #root 的密码,初次默认没有,直接回车

Enter current password for root (enter for none):  #再次确认,直接回车
...

Switch to unix_socket authentication [Y/n] n #是否切换到unix套接字身份验证
...

Change the root password? [Y/n] #设置新 root 密码
New password: 
Re-enter new password: 
 ... Success!

Remove anonymous users? [Y/n] #是否删除匿名用户
...

Disallow root login remotely? [Y/n] #是否禁止root远程登录
...

Remove test database and access to it? [Y/n] #是否删除test数据库
...

Reload privilege tables now? [Y/n] #是否重新加载权限表

Thanks for using MariaDB!

Remember: only run it if you're not prompted the password during setup.

It is really important that you remember this password, since it'll be useful later on.

Install wkhtmltopdf

sudo apt install xvfb libfontconfig

Download and install wkhtmltopdf package from https://wkhtmltopdf.org/downloads.html, then run this command to install the package.

sudo dpkg -i [wkhtmltox_file.deb]
sudo apt --fix-broken install #上一条报错,这一条补救

给的官网是正确的,但是只有 debian11 版本的。
在这里下载最新的:Release 0.12.6.1 r3 · wkhtmltopdf/packaging

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb #需科学上网

不推荐使用 dpkg 安装,因为它“只管安装,不管售后”。
使用 apt 能自动补全缺失依赖。

sudo apt install ./wkhtmltox_0.12.6.1-3.bookworm_amd64.deb

验证

wkhtmltopdf --version

#Common dependencies

Install nvm, node, and yarn

We recommend installing node using nvm

sudo apt install curl -y
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash #需科学上网

After nvm is installed, you may have to close your terminal and open another tab/window, or source your shell's rc file (example: ~/.bashrc or ~/.zshrc. Then run the following command to install node.

nvm install 24

Verify the installed version, by running:

node -v
#v24.xx.xx

Finally, install yarn using npm
Download and install Yarn:

corepack enable yarn

Install uv and python

We recommend using python using uv

curl -LsSf https://astral.sh/uv/install.sh | sh

After uv is installed, you may have to close your terminal and open another tab/window, or source your shell's rc file (example: ~/.bashrc or ~/.zshrc. Then run the following command to install python.

uv python install 3.14 --default
python -V
#3.14.xx

Alternatively, you can choose between 3.10-3.13 for version 15.

#Install Bench CLI

Install bench via pip

uv tool install frappe-bench

Confirm the bench installation by checking the version

bench --version

Create your first bench.

mkdir ~/frappe
cd ~/frappe
bench init my-bench #需科学上网

Congratulations, you have installed bench onto your system.


Source: Installation