Skip to content
  • I had issue on last flectra 1.7 install on ubuntu 20.04 command in snippets sudo npm install -g less less-plugin-clean-css rtlcss -y have installed v4.0.0 of less package which makes flectra crash. I needed to revert to less@3.13.0 to make the application works properly.

  • Contributor

    Small edit to help this script run without error on Ubuntu 20.4 at clean installation

    sudo adduser --system --quiet --shell=/bin/bash --home=/opt/flectra --gecos 'flectra' --group flectra
    sudo mkdir /etc/flectra && mkdir /var/log/flectra/
    sudo apt-get update && apt-get upgrade -y && apt-get install postgresql postgresql-server-dev-12 build-essential python3-pillow python3-lxml python3-dev python3-pip python3-setuptools npm nodejs git gdebi libldap2-dev libsasl2-dev  libxml2-dev libxslt1-dev libjpeg-dev -y
    sudo service postgresql restart
    git clone --depth=1 --branch=1.0 /opt/flectra/flectra
    sudo chown flectra:flectra /opt/flectra/ -R && sudo chown flectra:flectra /var/log/flectra/ -R && cd /opt/flectra/flectra && sudo pip3 install -r requirements.txt
    sudo apt-get install software-properties-common
    sudo apt install nodejs npm
    sudo npm install -g less@3.13.0 postcss@^8.2.1 less-plugin-clean-css rtlcss -y
    cd /tmp && wget && sudo gdebi -n wkhtmltox_0.12.5-1.bionic_amd64.deb && rm wkhtmltox_0.12.5-1.bionic_amd64.deb
    sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin/ && sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin/
    sudo su - postgres -c "createuser -s flectra"
    sudo su - flectra -c "/opt/flectra/flectra/flectra-bin --addons-path=/opt/flectra/flectra/addons -s --stop-after-init"
    sudo mv /opt/flectra/.flectrarc /etc/flectra/flectra.conf
    sudo sed -i "s,^\(logfile = \).*,\1"/var/log/flectra/flectra-server.log"," /etc/flectra/flectra.conf
    sudo sed -i "s,^\(logrotate = \).*,\1"True"," /etc/flectra/flectra.conf
    sudo sed -i "s,^\(proxy_mode = \).*,\1"True"," /etc/flectra/flectra.conf
    sudo cp /opt/flectra/flectra/debian/init /etc/init.d/flectra && chmod +x /etc/init.d/flectra
    sudo ln -s /opt/flectra/flectra/flectra-bin /usr/bin/flectra
    sudo update-rc.d -f flectra start 20 2 3 4 5 .
    sudo service flectra restart

    some extra note:

    • change worker on flectra.conf >0
    • install nginx with detail config as below:
    • install certbot with detail:

    sudo apt install certbot python3-certbot-nginx

    vi /etc/nginx/conf.d/domain.conf

    upstream flectra {
        server weight=1 fail_timeout=300s;
    upstream flectra-im {
        server weight=1 fail_timeout=300s;
    server {
        # server port and name
        listen 80;
        # Specifies the maximum accepted body size of a client request, 
        # as indicated by the request header Content-Length. 
        client_max_body_size 200m;
        #log files
        access_log    /var/log/nginx/flectra-access.log;
        error_log    /var/log/nginx/flectra-error.log;
        proxy_connect_timeout       600;
        proxy_send_timeout          600;
        proxy_read_timeout          600;
        send_timeout                600;
        keepalive_timeout    600;
        gzip on;
        gzip_disable "msie6";
        gzip_vary on;
        gzip_proxied any;
        gzip_comp_level 6;
        gzip_buffers 16 8k;
        gzip_http_version 1.1;
        gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss application/rss+xml text/javascript image/svg+xml application/ application/x-font-ttf font/opentype image/bmp image/png image/gif image/jpeg image/jpg;
        # increase proxy buffer to handle some OpenERP web requests
        proxy_buffers 16 64k;
        proxy_buffer_size 128k;
        location / {
            proxy_pass    http://flectra;
            # force timeouts if the backend dies
            proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
    	# Add Headers for odoo proxy mode
    	# set headers
     	proxy_set_header X-Forwarded-Host $host;
     	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     	proxy_set_header X-Forwarded-Proto $scheme;
     	proxy_set_header X-Real-IP $remote_addr;
            # by default, do not forward anything
            # proxy_redirect off;
        location /longpolling {
        	 proxy_pass    http://flectra-im;
        # cache some static data in memory for 60mins.
        # under heavy load this should relieve stress on the web interface a bit.
        location ~* /web/static/ {
            proxy_cache_valid 200 60m;
            proxy_buffering    on;
            expires 864000;
            proxy_pass http://flectra;

    certbot --nginx -d

    systemctl restart nginx

    systemctl restart flectra

    Edited by THANH VO
  • Contributor

    Just updated another version of this Snippet with detail process for beginer to install new Flectra or Convert from Odoo 11 to flectra:

0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment