gd_workshops

Installtion of Frappe

Easiest method via Docker using Frappe-Manager

OS: Debian 12 fresh install

Reference: https://github.com/rtCamp/Frappe-Manager

Pre-requisite: python 3.11+ and docker

Check python version:

ced@deb12:~$ python3 -V
Python 3.11.2

Python version > 3.11, so Ok

su -
Enter password

You become root, $ prompt will change to #

visudo

Locate the following

# User privilege specification
root    ALL=(ALL:ALL) ALL

and make it by adding a line, in case your username is ced (replace ced with your username)

# User privilege specification
root    ALL=(ALL:ALL) ALL
ced     ALL=(ALL:ALL) ALL

Save file and exit the editor.

Type again exit on # prompt to move from root to normal user, in my case ced

root@deb12:~# exit
ced@deb12:~$ 

You should see your and `$` prompt.

Open file ~/.bashrc in any editor, and add following at the end of file

export PATH=$PATH:/home/ced/.local/bin

Install Docker:

Ref: https://docs.docker.com/engine/install/debian/

Put following in frappeInstall01.sh file:

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl -y
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y

Issue the command:

bash frappeInstall01.sh

Add user to usergroup docker

sudo usermod -aG docker ced
sudo reboot

Open the terminal again by typing ter search bar, and selecting Terminal icon.

Check docker installation:

docker --version

If you see somethig like Docker version 27.1.1, build 6312585, then all good.

Issue command:

docker run hello-world

If message indicate that docker installtion is successful (as given below) then proceed further.

docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Pull complete 
Digest: sha256:1408fec50309afee38f3535383f5b09419e6dc0925bc69891e79d84cc4cdcec6
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

ced@deb12:~$ 

Create a file frappeInstall02.sh with content:

sudo apt install python3-pip -y
pip install frappe-manager --break-system-packages
fm --install-completion

Save fie and close the editor. Issue the command:

bash frappeInstall02.sh

Close the terminal and open the new one.

To create website with URL hsr.com (give any name of your choice):

time fm create hsr.com

It’s output will be:

πŸ”„ Pending Migrations...
πŸ“¦ v0.9.0
πŸ“¦ v0.10.0
πŸ“¦ v0.11.0
πŸ“¦ v0.12.0
πŸ“¦ v0.13.0
πŸ“¦ v0.13.1
πŸ“¦ v0.14.0
πŸ“¦ v0.15.0

⏳ This process may take a while.
πŸ“˜ For a manual migration guide, visit
https://github.com/rtCamp/Frappe-Manager/wiki/Migrations#manual-migration-proced
ure

Options :

[yes] Start Migration: Proceed with the migration process.
[no]  Abort and Revert: Do not migrate and revert to the previous fm version.

Do you want to proceed with the migration ? [yes/no]: yes
────────────────────────────────── πŸ“¦ v0.9.0 ───────────────────────────────────
βœ… Moved benches from /home/ced/frappe to /home/ced/frappe/sites
────────────────────────────────── πŸ“¦ v0.10.0 ──────────────────────────────────
βœ… Generated services compose file.
βœ… Created services at /home/ced/frappe/services.
────────────────────────────────── πŸ“¦ v0.11.0 ──────────────────────────────────
────────────────────────────────── πŸ“¦ v0.12.0 ──────────────────────────────────
βœ… Image pulled ghcr.io/rtcamp/frappe-manager-frappe:v0.12.0
────────────────────────────────── πŸ“¦ v0.13.0 ──────────────────────────────────
────────────────────────────────── πŸ“¦ v0.13.1 ──────────────────────────────────
βœ… Added fm header config to nginx-proxy.
────────────────────────────────── πŸ“¦ v0.14.0 ──────────────────────────────────
βœ… Migrated fm_config.toml
────────────────────────────────── πŸ“¦ v0.15.0 ──────────────────────────────────
βœ… Image pulled jwilder/nginx-proxy:1.6
βœ… Migrated services compose
βœ… Restarted services
❌ Docker image 'ghcr.io/rtcamp/frappe-manager-frappe:v0.15.0' is not available
locally
❌ Docker image 'ghcr.io/rtcamp/frappe-manager-nginx:v0.15.0' is not available
locally
❌ Docker image 'redis:6.2-alpine' is not available locally
❌ Docker image 'ghcr.io/rtcamp/frappe-manager-mailhog:v0.8.3' is not available
locally
❌ Docker image 'adminer:4' is not available locally
❌ Error Occured  hsr.com : Required docker images not available. Pull all
required images using command 'fm self update images'.
πŸ” More info about error is logged in /home/ced/frappe/logs/fm.log

real    7m34.764s
user    0m6.315s
sys    0m1.555s

If no such error occured, then skip the next 2 commands:

time fm self update images

It’s output is:

βœ… Pulled ghcr.io/rtcamp/frappe-manager-frappe:v0.15.0.
βœ… Pulled ghcr.io/rtcamp/frappe-manager-nginx:v0.15.0.
βœ… Pulled redis:6.2-alpine.
βœ… Pulled mariadb:10.6.
βœ… Pulled jwilder/nginx-proxy:1.6.
βœ… Pulled ghcr.io/rtcamp/frappe-manager-mailhog:v0.8.3.
βœ… Pulled adminer:4.

real	4m41.825s
user	0m5.437s
sys 	0m0.628s

Issue command:

time fm create hsr.com

It’s output is:

βœ… Created all required directories.
βœ… Started bench services.
βœ… Configured common_site_config.json
βœ… Configured frappe server
βœ… Configured supervisor configs
βœ… Configured frappe app's branch -> version-15
βœ… global-db:3306 is available after 0 seconds
βœ… hsrcom-redis-cache:6379 is available after 0 seconds
βœ… hsrcom-redis-queue:6379 is available after 0 seconds
βœ… hsrcom-redis-socketio:6379 is available after 0 seconds
βœ… Removed prebaked app erpnext
βœ… Removed prebaked app hrms
βœ… Created bench site hsr.com
βœ… Installed app frappe in site.
βœ… Installed dev packages in env.
βœ… Configured and Started dev services.
βœ… Reloaded nginx.
βœ… Configured Mailhog as default mail server.
βœ… Enabled Admin-tools.
βœ… Restarted frappe server
βœ… Workers compose not present. Generating...
βœ… Saved bench config.
βœ… Bench site is active and responding.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Bench Url         β”‚ http://hsr.com                               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Bench Root        β”‚ /home/ced/frappe/sites/hsr.com               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Frappe Username   β”‚ administrator                                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Frappe Password   β”‚ S3Kre                                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Root DB User      β”‚ root                                         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Root DB Password  β”‚ 7@cOI!S@e?@+_rt!f---+XD+4w3-6_Zs             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Root DB Host      β”‚ global-db                                    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ DB Name           β”‚ hsr-com                                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ DB User           β”‚ hsr-com                                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ DB Password       β”‚ uEKz9DOxSvGdjfk6                             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Environment       β”‚ dev                                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ HTTPS             β”‚ Not Enabled                                  β”‚     
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Admin Tools       β”‚ Tool     ┃ URL                               β”‚
β”‚                   β”‚ ━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ β”‚
β”‚                   β”‚ Mailhog  β”‚ http://hsr.com/mailhog            β”‚
β”‚                   β”‚ ────────────┼─────────────────────────────── β”‚
β”‚                   β”‚ Adminer  β”‚ http://hsr.com/adminer            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Bench Apps        β”‚ App               ┃ Version                  β”‚
β”‚                   β”‚ ━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━ β”‚
β”‚                   β”‚ frappe            β”‚ 15.37.0                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Bench Services    β”‚  frappe         βœ“          nginx          βœ“  β”‚
β”‚                   β”‚  redis-cache    βœ“          redis-queue    βœ“  β”‚
β”‚                   β”‚  redis-socketio βœ“          schedule       βœ“  β”‚
β”‚                   β”‚  socketio       βœ“                            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Bench Workers     β”‚  long-worker    βœ“          short-worker   βœ“  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Bench Admin Tools β”‚  adminer        βœ“          mailhog        βœ“  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
βœ… Please note that You will have to add a host entry to your system's hosts file to access the bench locally.

real    7m52.632s
user    0m27.123s
sys    0m22.283s

Add 27.0.0.1 hsr.com in file /etc/hosts

to make this file look like (a part of file):

127.0.0.1    localhost
127.0.0.1    hsr.com

New line added is the last line as per above.