Easiest Installation (LXC)

I may have found the easiest installation method for development and testing. You can try it on your existing infrastructure, on your laptop or on a brand new server. Most probably it won’t broke anything on your server.

snap install lxd
lxd init
lxc launch ubuntu:18.04 frappe-dev
lxc exec frappe-dev -- /bin/bash

–Now you are in the container. Just follow the easy steps with one more step

sudo apt-get install python3-minimal build-essential python3-setuptools
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
sudo mkdir -p /run/dbus
sudo dbus-daemon --system
python3 install.py --develop --version 12 --user=frappe

That’s it. Cheers.

6 Likes

I had an error within the this step:
become-user=frappe or localectl throws “Connection timed out” error.
So I’ve issued these commands.
sudo mkdir -p /run/dbus
sudo dbus-daemon --system

I believe that Win10 WSL also use this kind of technology. So above commands also fixes some problems in the WSL. Ref: Solution for error locale : Check current locale on wsl ubuntu windows

2 Likes

Hello @TurkerTunali,
Thanks for the tuto but i almost find the same issue during the setup of first company
‘SETUP FAILED Could not start up: Error in setup’

Hi @Insightlab ,
You should create an github issue with the detailed logs. Without logs developers can’t help.

Did you look it up in the forum ? [solved] "Setup failed: Could not start up: Error in setup"

Hi @TurkerTunali, Thanks for your support
The Forum helps me to solve the issue after many retry retry retry … retry

That’s how winning is done :slight_smile:

What does this command do? Do you issue it before running the install script?

I should be more clear. You are right.
This script installs lxc which is a container technology like docker.
Then installs ubuntu18 and ERPNext in that container.
Your local configuration won’t be affected most probably because installation is on the virtual server.
It may come handy when you must use Easy Script and you have trouble on local computer.

1 Like

Sorry - I should have been more succinct. The dbus command - I tried looking it up on internet - and it seems to be related to communication between programs. Does it resolve the error of become-user=frappe? I read on erpnext forum to use --container flag with script or create a user within lxd container called frappe and then run install script. Just wondering how you resolved the become-user error. Thanks.

I don’t think if it resolves become-user problem. My problem was localectl throwing “Connection timed out” error.
I think become-user problem is a generic one. You may get more info about the error by adding --verbose flag. That way you can get exact command which is failing and you may search better.

Today I also get an Request Timeout error in the setup wizard. I set http timeout as 6000 as suggested here Setup Wizard Request Timeout Then I’ve reverted back to 120.

We should also use --container flag when installing.

1 Like

After the lxc exec frappe-dev – /bin/bash command - I would run the following:
adduser frappe
su - frappe
sudo apt-get install python3-minimal build-essential python3-setuptools
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
python3 install.py --develop --version 12 --user=frappe --container

exit the container and then forward WAN port 80 of host to container port 80 /443:

lxc config device add mycontainer myport80 proxy listen=tcp:0.0.0.0:80 connect=tcp:127.0.0.1:80

lxc config device add mycontainer myport443 proxy listen=tcp:0.0.0.0:443 connect=tcp:127.0.0.1:443
3 Likes

Thanks. I’ve trouble when configuring network.

You can use Nginx or Haproxy container as a “portal / gateway to the outside” that redirects incoming traffic (reverse proxy) to other containers… similar to ERPNext docker install… The default lxd init profile sets up the networking between containers automatically with a bridge to the eth0 of the host and each container can be pointed to by its internal domain (containername.lxd) or internal LAN ip address. Is quite straight forward and has been working well for us in production… For more complicated networking setup like macvlan, etc there are some nice blogs on lxd/lxc setup - by Simos and Stefane Graber - google it and you can find them easily - recommended reading…

For the time being, my computer usually gets an IP from my router like 192.168.X.X but containers get IP like 10.X.X.X . They can reach the internet and I’ve installed the ERPNext but I can’t reach it from my browser. I can ping 10.X.X.X ip but my browser can’t access it.
How can I make my containers also get an IP from my router, like 192.168.X.X ?

Are you sure you want to expose your containers directly? In any case what you are looking for is called MACVLAN networking - where your host ethernet card is associated with virtual MAC addresses (multiple - one for each container). Follow this guide:

1 Like

Thank you. I will use that configuration in my laptop for development purposes. How did you configure your containers in your laptop? MACVLAN or bridged?

I am using a VM (KVM type) in the cloud… Is also quite easy to setup Nginx reverse proxy container - and direct all traffic to it first - then let it parse the traffic and redirect to appropriate container… Your containers remain behind the host firewall and you can setup protections such against attacks by limiting rates, etc… Please also check if the host can communicate with the containers with macvlan.

2 Likes

So your development environment is also in the cloud. Mind blowing.