Skip to content

Instantly share code, notes, and snippets.

@weiserman
Last active November 21, 2025 08:36
Show Gist options
  • Select an option

  • Save weiserman/c13cdfc07b360bdfe27f419e53371532 to your computer and use it in GitHub Desktop.

Select an option

Save weiserman/c13cdfc07b360bdfe27f419e53371532 to your computer and use it in GitHub Desktop.
Frappe Bench on Digital Ocean droplet

Guide-to-Install-Frappe-on-Digital-Ocean-Droplet

A guide to Install Frappe Bench v14 on Ubuntu 22.04 LTS and start building the Library Tutorial I hope this makes your Frappe development and exploration more simpler. Frappe Cloud provides great capabilities too. This is for a development server and not for a production build (obviously)

Pre-requisites before your start

  Digital Ocean account and a droplet created
  Ubuntu 22.04 LTS
  Shared CPU with SSD
  Access via SSH configured incl. knowledge of root password

STEP 1 SSH into your droplet and set up a 1Gig SWAP file (for performance reasons)

df -h
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

STEP 2 Check SWAP file is configured correctly, and make permanenet in config

sudo swapon --show
free -h
sudo cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

STEP 3 Update apt-get for latest package files

sudo apt-get update

STEP 4 Create an Sudo unix user for installation (using Warren as username in this example)

adduser warren

follow the prompts and create new password and details

usermod -aG sudo warren

STEP 5 install git and python-dev and python package manager

sudo apt-get install git
sudo apt-get install python3-dev
sudo apt-get install python3-setuptools python3-pip

STEP 6 Install virtualenv

sudo apt-get install virtualenv
sudo apt install python3.10-venv

STEP 7 Install MariaDB

sudo apt-get install software-properties-common
sudo apt install mariadb-server
sudo /etc/init.d/mariadb start

STEP 8 Secure the MariaDB installation

sudo mysql_secure_installation
when prompted select the following options:
  Switch to unix_socket authentication [Y/n] Y
  Change the root password? [Y/n] Y
  Remove anonymous users? [Y/n] Y
  Disallow root login remotely? [Y/n] Y
  Remove test database and access to it? [Y/n] Y
  Reload privilege tables now? [Y/n] Y

STEP 9 MySQL database development files

sudo apt-get install libmysqlclient-dev

STEP 10 Edit the mariadb configuration ( unicode character encoding )

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
 comment out or delete all other entries and add this to the 50-server.cnf file
[server]
user = mysql
pid-file = /run/mysqld/mysqld.pid
socket = /run/mysqld/mysqld.sock
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
bind-address = 127.0.0.1
query_cache_size = 16M
log_error = /var/log/mysql/error.log
    
[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci      
     
[mysql]
default-character-set = utf8mb4

STEP 11 Restart MariaDB

sudo service mariadb restart

STEP 12 install Redis

sudo apt-get install redis-server

STEP 13 install Node.js and NPM

sudo apt install curl
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile
nvm install 14.15.0

STEP 14 install Yarn

sudo apt-get install npm
sudo npm install -g yarn

STEP 15 install wkhtmltopdf

sudo apt-get install xvfb libfontconfig wkhtmltopdf

STEP 16 Change from root user and install frappe-bench (user warren in example below)

su - warren
sudo -H pip3 install frappe-bench
bench --version

change permission of home directory

chmod -R o+rx /home/warren/

STEP 17 initialise & install frappe latest version

bench init frappe-bench 
bench start

STEP 18 (Optional) Set up Supervisor to run bench in background

sudo apt-get install supervisor
bench setup supervisor
sudo ln -s `pwd`/config/supervisor.conf /etc/supervisor/conf.d/frappe-bench.conf
sudo supervisorctl reread

you should see the configuration items listed for bench

sudo supervisorctl update
sudo supervisorctl status

you should see the processes running with the relevant Process IDs

sudo nano /etc/supervisor/supervisord.conf

Update the file with these values (note the user I have is warren, change it to your user that you created for Frappe)

[unix_http_server]
file=/var/tmp/supervisord.sock
chmod=0700
chown=warren:warren
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment