Home linux trying install odoo17
linux

trying install odoo17

  • install ubuntu 18.04 on your pc
  • active port ssh non standard, example 50022
  • install nano wget neofetch
  • crontab -e on root
    @reboot /root/reboot-sudo.sh

     

  • nano reboot-sudo.sh, fill this code
  • systemctl restart sshd
    systemctl restart ssh

     

  • chmod 777 reboot-sudo.sh
  • create new user, with sudoer, (install visudo), example adduser ronny
  • access sudoer with password less
    • apt-get update
    • apt-get upgrade
  • use puttygen to access via ppk and pem file
    • open puttygen on windows
    • create new private key
    • save to private key ppk
    • copy to template public key
    • use your sudoer
    • mkdir ~/.ssh
    • chmod 700 ~/.ssh
    • nano ~/.ssh/authorized_keys
    • paste public key template to this file and save
    • chmod 600 ~/.ssh/authorized_keys
    • use putty with that ppk and port
  • set datetime zone to jakarta using timedatectl
  • ronny@odoo17:~$ sudo apt-get install fail2ban
    ronny@odoo17:~$ sudo apt-get install -y python3-pip
    ronny@odoo17:~$ sudo apt-get install python-dev python3-dev libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev build-essential libssl-dev libffi-dev libmariadb-dev libmariadb-dev-compat libjpeg-dev libpq-dev libjpeg62-turbo-dev liblcms2-dev libblas-dev libatlas-base-dev
    ronny@odoo17:~$ sudo apt-get install -y npm
    ronny@odoo17:~$ sudo ln -s /usr/bin/nodejs /usr/bin/node
    ronny@odoo17:~$ sudo npm install -g less less-plugin-clean-css
    ronny@odoo17:~$ sudo apt-get install -y node-less
    ronny@odoo17:~$ sudo apt-get install postgresql
    ronny@odoo17:~$ sudo su - postgres
    postgres@odoo17:~$ createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo17
    Enter password for new role:
    Enter it again:
    postgres@odoo17:~$ psql
    psql (13.15 (Debian 13.15-0+deb11u1))
    Type "help" for help.
    
    postgres=# ALTER USER odoo17 WITH SUPERUSER;
    ALTER ROLE
    postgres=#
    postgres=# \q
    postgres@odoo17:~$ exit
    logout
    ronny@odoo17:~$
    
    ronny@odoo17:~$ sudo adduser --system --home=/opt/odoo17 --group odoo17
    ronny@odoo17:~$ sudo apt-get install git
    ronny@odoo17:~$ sudo su - odoo17 -s /bin/bash
    odoo17@odoo17:~$ git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 --single-branch .
    Cloning into '.'...
    warning: redirecting to https://github.com/odoo/odoo.git/
    remote: Enumerating objects: 40357, done.
    remote: Counting objects: 100% (40357/40357), done.
    remote: Compressing objects: 100% (31610/31610), done.
    remote: Total 40357 (delta 10499), reused 26580 (delta 7345), pack-reused 0
    Receiving objects: 100% (40357/40357), 162.15 MiB | 4.14 MiB/s, done.
    Resolving deltas: 100% (10499/10499), done.
    Updating files: 100% (34823/34823), done.
    
    odoo17@odoo17:~$ exit
    ronny@odoo17:~$ sudo pip3 install -r /opt/odoo/requirements.txt
    
    ronny@odoo17:~$ sudo pip3 install -r /opt/odoo17/requirements.txt
    ronny@odoo17:~$ sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
    ronny@odoo17:~$ sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
    ronny@odoo17:~$ wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.bullseye_amd64.deb
    ronny@odoo17:~$ sudo apt --fix-broken install
    ronny@odoo17:~$ sudo dpkg -i wkhtmltox_0.12.6.1-2.bullseye_amd64.deb
    ronny@odoo17:~$ sudo apt install -f
    ronny@odoo17:~$ sudo cp /opt/odoo17/debian/odoo.conf /etc/odoo17.conf
    ronny@odoo17:~$ sudo nano /etc/odoo17.conf
    
    [options]
       ; This is the password that allows database operations:
       admin_passwd = admin
       db_host = False
       db_port = False
       db_user = odoo17
       db_password = False
       addons_path = /opt/odoo17/addons
       logfile = /var/log/odoo/odoo17.log
    ronny@odoo17:~$ sudo chown odoo17: /etc/odoo17.conf
    ronny@odoo17:~$ sudo chmod 640 /etc/odoo17.conf
    ronny@odoo17:~$ sudo mkdir /var/log/odoo
    ronny@odoo17:~$ sudo chown odoo17:root /var/log/odoo
    ronny@odoo17:~$ sudo nano /etc/systemd/system/odoo17.service
    
    [Unit]
       Description=Odoo17
       Documentation=http://www.odoo.com
       [Service]
       # Ubuntu/Debian convention:
       Type=simple
       User=odoo17
       ExecStart=/opt/odoo17/odoo-bin -c /etc/odoo17.conf
       [Install]
       WantedBy=default.target

    ronny@odoo17:~$ sudo chmod 755 /etc/systemd/system/odoo17.service
    ronny@odoo17:~$ sudo chown root: /etc/systemd/system/odoo17.service
    ronny@odoo17:~$ sudo systemctl start odoo17.service
    ronny@odoo17:~$ sudo systemctl status odoo17.service

     

  • update python 3.10
    ronny@odoo17:~$ python3 --version
    Python 3.9.2
    ronny@odoo17:~$ sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev
    ronny@odoo17:~$ wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz
    ronny@odoo17:~$ tar -xvf Python-3.10.0.tgz
    ronny@odoo17:~$ cd Python-3.10.0
    ronny@odoo17:~/Python-3.10.0$ sudo ./configure --enable-optimizations
    ronny@odoo17:~/Python-3.10.0$ sudo make -j 2
    ronny@odoo17:~/Python-3.10.0$ sudo make altinstall
    ronny@odoo17:~/Python-3.10.0$ python3.10 --version
    Python 3.10.0
    ronny@odoo17:/usr/bin$ whereis python3.10
    python3: /usr/bin/python3.9-config /usr/bin/python3 /usr/bin/python3.9 /usr/lib/python3.9 /usr/lib/python3 /etc/python3.9 /etc/python3 /usr/local/bin/python3.10 /usr/local/bin/python3.10-config /usr/local/lib/python3.10 /usr/local/lib/python3.9 /usr/include/python3.9 /usr/share/python3 /usr/share/man/man1/python3.1.gz
    ronny@odoo17:/usr/bin$ alias python=/usr/local/bin/python3.10
    ronny@odoo17:/usr/bin$ alias python3=/usr/local/bin/python3.10
    ronny@odoo17:/usr/bin$ python3 --version
    Python 3.10.0
    
    ronny@odoo17:/usr/bin$ sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3.10 1
    
    
    sudo systemctl status odoo17.service
    sudo systemctl restart odoo17.service
    sudo pip install rjsmin

     

  • if there is error about css, use this code
    ronny@odoo17:~$ sudo pip install libsass
    ronny@odoo17:~$ sudo pip install qrcode
    ronny@odoo17:~$ sudo pip install phonenumbers
    ronny@odoo17:~$ sudo pip install zeep
    ronny@odoo17:~$ sudo pip install python-stdnum

    sudo apt-get install pkgconf
    sudo apt-get install build-essential
    sudo apt-get install libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
    sudo pip install rlPyCairo
    sudo pip install rl-renderPM
    sudo pip install reportLab



    ronny@odoo17:/var/log/odoo$ sudo pip install "reportlab[pycairo]"
    ronny@odoo17:/var/log/odoo$ sudo python -m pip install --upgrade --force-reinstall reportLab
    sudo apt-get install python3-renderpm

    ronny@odoo17:/var/log/odoo$ sudo apt install build-essential pkg-config python3-dev libcairo2-dev

     

Author

Ronny

Leave a Reply