> For the complete documentation index, see [llms.txt](https://docs-epc.gitbook.io/ncs-documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-epc.gitbook.io/ncs-documents/tutorial/install-odoo18-with-external-database.md).

# Install odoo18 with external database

### Prerequisite

* มียอดเงินคงเหลือใน Project มากกว่า 0 บาท ([ขั้นตอนการเติมเงินเข้าสู่ Project](/ncs-documents/nipa-cloud-space-overview/billing-and-wallet/topup-a-project-wallet.md))

## Instructions

### 1. ทำการสร้าง instance 2 เครื่อง&#x20;

โดยใช้ Deployment Script ชื่อ odoo18 และ postgresql-odoo

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

### 2. console ไปที่เครื่อง postgresql database&#x20;

เพื่อเก็บ value ต่าง ๆ มาใช้ที่ odoo server

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

<figure><img src="/files/ZShGj3VpGUR1ChCtFEvd" alt=""><figcaption><p>value ที่ต้องเก็บคือ IPv4, Username_db และ Password_db</p></figcaption></figure>

### 3. จากนั้น console ไปที่เครื่อง odoo18

เพื่อดำเนินการแก้ไข file อยู่ที่ path /etc/odoo18.conf แล้วให้เปลี่ยน configure ของ parameter ดังนี้

*db\_host = IPv4 postgresql database server*\
*db\_port = 5432*\
*db\_user = Username\_db*\
*db\_password = Password\_db*

<figure><img src="/files/7rZa1ryMqqArsCsR81i8" alt=""><figcaption><p>ตัวอย่างวิธีการ configure</p></figcaption></figure>

### 4. จากนั้นดำเนินการ restart odoo18 ที่ odoo server

`systemctl restart odoo18.service`

`systemctl status odoo18.service`

<figure><img src="/files/HJ0L95r1fs1ycyMRAEE8" alt=""><figcaption><p>expected output</p></figcaption></figure>

### 5. ทดสอบเข้าใช้งาน

ทดสอบเข้าใช้งานผ่าน External\_IP:8069

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

{% hint style="info" %}
หากต้องการใช้งานผ่าน LoadBalancer สามารถดูวิธีการติดตั้ง LoadBalancer ได้ที่ [LOAD BALANCING](/ncs-documents/load-balancing/load-balancer.md)
{% endhint %}
