# Menginstall Odoo di Ubuntu Server 22.04

Disini akan menggunakan container Proxmox dengan Ubuntu Server 22.04. Jika kalian menggunakan VM, tidak menjadi masalah asalkan tetap Ubuntu Server versi 22.04. Karena disini saya login sebagai root, maka tidak perlu sudo.

## 1. Update dan Upgrade Package

```
apt update -y && apt upgrade -y
```

## 2. Menginstall Package Python

```
apt install build-essential wget git python3.11-dev python3.11-venv \
libfreetype-dev libxml2-dev libzip-dev libsasl2-dev \
node-less libjpeg-dev zlib1g-dev libpq-dev \
libxslt1-dev libldap2-dev libtiff5-dev libopenjp2-7-dev libcap-dev
```

## 3. Membuat User Baru "odoo17"

```
/usr/sbin/adduser --system --shell /bin/bash --gecos 'Odoo user' --group --home /opt/odoo17 odoo17
```

## 4. Menginstall Postgresql untuk Database

```
apt install postgresql
```

## 5. Membuat User Postgresql Baru

```
// masuk ke postgresql
sudo -u postgres psql

// buat user odoo17
CREATE USER odoo17 WITH SUPERUSER

// melihat user
\du

// keluar
\q
```

## 6. Menginstall wkthmltopdf

```
apt install wkhtmltopdf
```

## 7. Menginstall Odoo 17

```
// terlebih dahulu, pindah user ke odoo17
su odoo17

// karena ketika berpindah direktori masih /root, saya keluar dari direktori root
cd

// menginstall odoo dari github repository
git clone --depth 1 --branch 17.0 https://github.com/odoo/odoo odoo17
```

## 8. Membuat venv

```
// membuat venv baru dengan nama odoo17-venv
python3.11 -m venv odoo17-venv

// masuk ke venv
source odoo17-venv/bin/activate
```

## 9. Install Package Tambahan yang Dibutuhkan

```
pip3 install --upgrade wheel setuptools pip

pip3 install -r odoo17/requirements.txt
```

## 10. Membuat Direktori untuk Custom Addons

```
mkdir /opt/odoo17/odoo17/custom-addons

// keluar dari venv
exit
```

## 11. Membuat File Konfigurasi

Membuat file odoo17.conf

```
nano /etc/odoo17.conf
```

lalu paste dibawah:

```
[options]
admin_passwd = YourSecretPassword
db_host = False
db_port = False
db_user = odoo17
db_password = False
addons_path = /opt/odoo17/odoo17/addons,/opt/odoo17/odoo17/custom-addons
```

Membuat file odoo17.service

```
nano /etc/systemd/system/odoo17.service
```

lalu paste dibawah:

```
[Unit]
Description=odoo17
Requires=postgresql.service
After=network.target postgresql.service

[Service]
Type=simple
SyslogIdentifier=odoo17
PermissionsStartOnly=true
User=odoo17
Group=odoo17
ExecStart=/opt/odoo17/odoo17-venv/bin/python3 /opt/odoo17/odoo17/odoo-bin -c /etc/odoo17.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target
```

## 12. Terakhir, Reload Daemon dan Enable Odoo17

```
systemctl daemon-reload

systemctl enable --now odoo17

// untuk mengecek status odoo17
systemctl status odoo17
```

Selanjutnya, silahkan akses url berikut YOUR\_IP:8069 di browser Anda. Seharusnya muncul seperti ini

<figure><img src="/files/PbolXlGoj7920HaSsJFG" alt=""><figcaption></figcaption></figure>

Jika sudah muncul seperti diatas, Selamat! Anda berhasil menginstall Odoo versi 17 di ubuntu server Anda.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.devops.my.id/cloud-computing/menginstall-odoo-di-ubuntu-server-22.04.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
