<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PostgreSQL Archives - LinuxTuto</title>
	<atom:link href="https://www.linuxtuto.com/tag/postgresql/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.linuxtuto.com/tag/postgresql/</link>
	<description>Linux Sysadmin and DevOps blog</description>
	<lastBuildDate>Tue, 18 Mar 2025 10:25:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://www.linuxtuto.com/wp-content/uploads/2022/01/cropped-LT_faveicon-32x32.png</url>
	<title>PostgreSQL Archives - LinuxTuto</title>
	<link>https://www.linuxtuto.com/tag/postgresql/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">201456972</site>	<item>
		<title>How to Install PostgreSQL 17 on AlmaLinux 9</title>
		<link>https://www.linuxtuto.com/how-to-install-postgresql-17-on-almalinux-9/</link>
					<comments>https://www.linuxtuto.com/how-to-install-postgresql-17-on-almalinux-9/#respond</comments>
		
		<dc:creator><![CDATA[LinuxTuto]]></dc:creator>
		<pubDate>Tue, 18 Mar 2025 10:25:15 +0000</pubDate>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[AlmaLinux]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<guid isPermaLink="false">https://www.linuxtuto.com/?p=1875</guid>

					<description><![CDATA[<p>PostgreSQL (often called Postgres) is a powerful, open-source relational database management system (RDBMS). It is known for its scalability, extensibility, and strong compliance with SQL...</p>
<p>The post <a href="https://www.linuxtuto.com/how-to-install-postgresql-17-on-almalinux-9/">How to Install PostgreSQL 17 on AlmaLinux 9</a> appeared first on <a href="https://www.linuxtuto.com">LinuxTuto</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>PostgreSQL (often called Postgres) is a powerful, open-source relational database management system (RDBMS). It is known for its scalability, extensibility, and strong compliance with SQL standards.</p>
<p>If you’re running AlmaLinux 9 and need to set up PostgreSQL, you’re in the right place.</p>
<p>In this guide, I’ll walk you through the installation process step by step no stress, just what you need to get it up and running.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 1: Update Your System</span></h2>
<p>Before installing anything, let’s make sure your system is up to date. Open a terminal and run:</p>
<pre><code>dnf update &amp; dnf upgrade</code></pre>
<p>This ensures you have the latest security patches and software versions. It’s always a good habit to update before installing new software.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 2: Check Available PostgreSQL Versions</span></h2>
<p>AlmaLinux ships with multiple versions of PostgreSQL. To see what’s available, run:</p>
<pre><code>dnf module list postgresql</code></pre>
<p>You’ll get a list of PostgreSQL versions that you can install.</p>
<p><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-1884" src="https://www.linuxtuto.com/wp-content/uploads/2025/03/almalinux9-appstream.webp" alt="AlmaLinux 9 Appstream" width="900" height="81" srcset="https://www.linuxtuto.com/wp-content/uploads/2025/03/almalinux9-appstream.webp 900w, https://www.linuxtuto.com/wp-content/uploads/2025/03/almalinux9-appstream-300x27.webp 300w, https://www.linuxtuto.com/wp-content/uploads/2025/03/almalinux9-appstream-768x69.webp 768w, https://www.linuxtuto.com/wp-content/uploads/2025/03/almalinux9-appstream-897x81.webp 897w, https://www.linuxtuto.com/wp-content/uploads/2025/03/almalinux9-appstream-684x62.webp 684w" sizes="(max-width: 900px) 100vw, 900px" /></p>
<p>PostgreSQL server 15 and 16 are included in the <strong>AppStream</strong> components.</p>
<p>So to install PostgreSQL 17 we will need to add the following official repositories:</p>
<pre><code>dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm</code></pre>
<p>Disable the default PostgreSQL module once the repository has been added:</p>
<pre><code>dnf -qy module disable postgresql</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 3: Install PostgreSQL 17</span></h2>
<p>Now, let’s install the PostgreSQL 17 server and some extra tools:</p>
<pre><code>dnf install postgresql17-server postgresql17-contrib</code></pre>
<p>This will pull in all the necessary packages.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 4: Initialize the Database</span></h2>
<p>Before we can use PostgreSQL, we need to initialize the database.</p>
<p>Run this command:</p>
<pre><code>/usr/pgsql-17/bin/postgresql-17-setup initdb</code></pre>
<p>This sets up the default database files and configurations as well as the main configuration file <strong>/var/lib/pgsql/17/data/postgresql.conf</strong>.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 5: Start and Enable PostgreSQL 17</span></h2>
<p>Now, let’s start the PostgreSQL 17 service and make sure it runs automatically on system boot:</p>
<pre><code>systemctl enable --now postgresql-17</code></pre>
<p>To check if PostgreSQL is running, use:</p>
<pre><code>systemctl status postgresql-17</code></pre>
<p>If everything is working, you should see a message saying PostgreSQL is “active (running).”</p>
<pre><code>● postgresql-17.service - PostgreSQL 17 database server
     Loaded: loaded (/usr/lib/systemd/system/postgresql-17.service; enabled; preset: disabled)
     Active: active (running)
       Docs: https://www.postgresql.org/docs/17/static/
    Process: 104278 ExecStartPre=/usr/pgsql-17/bin/postgresql-17-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
   Main PID: 104283 (postgres)
      Tasks: 7 (limit: 14115)
     Memory: 17.7M
        CPU: 659ms
     CGroup: /system.slice/postgresql-17.service
             ├─104283 /usr/pgsql-17/bin/postgres -D /var/lib/pgsql/17/data/
             ├─104284 "postgres: logger "
             ├─104285 "postgres: checkpointer "
             ├─104286 "postgres: background writer "
             ├─104288 "postgres: walwriter "
             ├─104289 "postgres: autovacuum launcher "
             └─104290 "postgres: logical replication launcher "</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 6: Set a Password for the PostgreSQL 17</span></h2>
<p>User By default, PostgreSQL creates a user called <strong>postgres</strong>. You’ll want to set a password for it.</p>
<p>Switch to the<strong> postgres</strong> user with:</p>
<pre><code>su postgres</code></pre>
<p>Then, enter the PostgreSQL shell:</p>
<pre><code>psql</code></pre>
<p>Set a new password by running:</p>
<pre><code>ALTER USER postgres WITH PASSWORD 'your_secure_password';</code></pre>
<p>Replace <strong>&#8216;your_secure_password&#8217;</strong> with something strong! Once done, type <strong>\q</strong> to exit, then exit to return to your regular user.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 7: Backup and Restore a Single Database</span></h2>
<p>You can back up and restore a single database using the <code><strong>pg_dump</strong></code> utility.</p>
<p>For example, to back up a single database named <strong>db</strong> and generate a backup file named <strong>db_backup.sql</strong>, run the following command:</p>
<pre><code>su - postgres
pg_dump -d db -f db_backup.sql</code></pre>
<p>You can also restore a single database using <strong>psql</strong> command.</p>
<p>For example, to restore a single database named <strong>db</strong> from a backup file named <strong>db_backup.sql</strong>, run the following command:</p>
<pre><code>su - postgres
psql -d db -f db_backup.sql</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 8: Allow Remote Connections (Optional)</span></h2>
<p>By default, <a href="https://www.linuxtuto.com/how-to-install-postgresql-15-on-debian-11/">PostgreSQL</a> only allows local connections. If you need remote access, edit the config file:</p>
<pre><code>nano /var/lib/pgsql/17/data/postgresql.conf</code></pre>
<p>Find this line:</p>
<pre><code>#listen_addresses = 'localhost'</code></pre>
<p>Uncomment it and change it to:</p>
<pre><code>listen_addresses = '*'</code></pre>
<p>Then, edit the authentication settings:</p>
<pre><code>nano /var/lib/pgsql/17/data/pg_hba.conf</code></pre>
<p>Add this line at the bottom (replace 192.168.1.0/24 with your network range):</p>
<pre><code>host all all 192.168.1.0/24 md5</code></pre>
<p>Restart PostgreSQL for changes to take effect:</p>
<pre><code>sudo systemctl restart postgresql</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Comments and Conclusion</span></h2>
<p>You’re Done! That’s it. You now have PostgreSQL 17 server running on AlmaLinux 9!</p>
<p>You can start creating databases and working with your applications. If you have any issues, check the logs with:</p>
<pre><code>journalctl -u postgresql-17 --no-pager | tail -50</code></pre>
<p>For additional help or useful information, we recommend you to check  <a href="https://www.postgresql.org/docs/17/index.html" target="_blank" rel="noopener">the official PostgreSQL 17 documentation.</a></p>
<p>If you have any questions please leave a comment below.</p>
<p>The post <a href="https://www.linuxtuto.com/how-to-install-postgresql-17-on-almalinux-9/">How to Install PostgreSQL 17 on AlmaLinux 9</a> appeared first on <a href="https://www.linuxtuto.com">LinuxTuto</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxtuto.com/how-to-install-postgresql-17-on-almalinux-9/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1875</post-id>	</item>
		<item>
		<title>How to Install Odoo 18 on Ubuntu 24.04</title>
		<link>https://www.linuxtuto.com/how-to-install-odoo-18-on-ubuntu-24-04/</link>
					<comments>https://www.linuxtuto.com/how-to-install-odoo-18-on-ubuntu-24-04/#respond</comments>
		
		<dc:creator><![CDATA[LinuxTuto]]></dc:creator>
		<pubDate>Thu, 03 Oct 2024 12:00:03 +0000</pubDate>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[Odoo]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<guid isPermaLink="false">https://www.linuxtuto.com/?p=1808</guid>

					<description><![CDATA[<p>Odoo 18 is an open-source suite of business applications that provides a complete ERP (Enterprise Resource Planning) solution for organizations of various sizes. It offers...</p>
<p>The post <a href="https://www.linuxtuto.com/how-to-install-odoo-18-on-ubuntu-24-04/">How to Install Odoo 18 on Ubuntu 24.04</a> appeared first on <a href="https://www.linuxtuto.com">LinuxTuto</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Odoo 18 is an open-source suite of business applications that provides a complete ERP (Enterprise Resource Planning) solution for organizations of various sizes. It offers a wide range of integrated tools and modules to help manage all aspects of a business, such as finance, sales, inventory, human resources, and more.</p>
<p>The open-source community edition is free, making it accessible to small businesses and developers. The enterprise edition, on the other hand, offers additional features, services, and support.</p>
<p>Odoo is highly customizable. Businesses can tailor modules to meet their specific needs, create custom workflows, or build entirely new apps using Odoo’s development framework.</p>
<p>In summary, Odoo is a versatile business management software that can streamline operations and provide real-time insights, making it an ideal solution for companies looking to optimize their business processes.</p>
<p>In this tutorial, we will show you how to install Odoo 18 on a Ubuntu 24.04 OS.</p>
<h2><span class="has-inline-color has-vivid-purple-color">S</span><span class="has-inline-color has-vivid-purple-color">tep 1: Update Operating System</span></h2>
<p>Update your <strong>Ubuntu 24.04</strong> operating system to make sure all existing packages are up to date:</p>
<pre><code># apt update &amp;&amp; apt upgrade</code></pre>
<p>Then install all the required packages for the Odoo 18 setup on the Ubuntu 24.04 OS.</p>
<pre><code># apt install python3-minimal python3-dev python3-pip python3-venv python3-setuptools build-essential libzip-dev libxslt1-dev libldap2-dev python3-wheel libsasl2-dev node-less libjpeg-dev xfonts-utils libpq-dev libffi-dev fontconfig git wget</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 2: </span><span class="has-inline-color has-vivid-purple-color">Install PostgreSQL </span></h2>
<p>Odoo uses PostgreSQL as a database backend, so you will need to install PostgreSQL on your server.</p>
<p>Follow these steps to install and configure PostgreSQL server:</p>
<pre><code># apt-get install postgresql</code></pre>
<p>After the successful installation, start the PostgreSQL service and enable it to start after the system reboot:</p>
<pre><code># systemctl start postgresql
# systemctl enable postgresql</code></pre>
<p>Verify that is active and running on your server:</p>
<pre><code># systemctl status postgresql</code></pre>
<pre><strong>Output</strong>
<code>● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; preset: enabled)
     Active: active (exited)
   Main PID: 19754 (code=exited, status=0/SUCCESS)
        CPU: 2ms</code></pre>
<p>Now create an Odoo user in PostgreSQL:</p>
<pre><code># su - postgres -c "createuser -s odoo" </code></pre>
<p>This will add a new role <strong>odoo</strong> in the PostgreSQL server.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 3: Install Node.js</span></h2>
<p>To install Node.js and npm on your Ubuntu 24.04 OS use the following command:</p>
<pre><code># apt install nodejs npm</code></pre>
<p>Also, install the following module to enable RTL support:</p>
<pre><code># npm install -g rtlcss</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 4: Installation of wkhtmltopdf</span></h2>
<p>To generate PDF reports successfully, wkhtmltopdf is necessary. PDF reports are a crucial component of any organization.</p>
<p>First install the xfonts dependency before installing wkhtmltopdf:</p>
<pre><code># apt-get install xfonts-75dpi xfonts-base</code></pre>
<p>Now download and install <a href="https://wkhtmltopdf.org/downloads.html">wkhtmltopdf</a> using the following commands:</p>
<pre><code># wget  http://security.ubuntu.com/ubuntu/pool/universe/w/wkhtmltopdf/wkhtmltopdf_0.12.6-2build2_amd64.deb
# dpkg -i wkhtmltopdf_0.12.6-2build2_amd64.deb</code></pre>
<p>Verify if the wkhtmltopdf installation is successful by checking the version:</p>
<pre><code># wkhtmltopdf --version
wkhtmltopdf 0.12.6</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 5: Create an Odoo User</span></h2>
<p>Create a new system user for managing the Odoo processes on the Odoo server.</p>
<pre><code># adduser --system --group --home=/opt/odoo --shell=/bin/bash odoo</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 6: Install Odoo 18</span></h2>
<p>Switch to the user that you have created before to avoid encountering issues related to access rights.</p>
<pre><code># su - odoo</code></pre>
<p>Now, download the Odoo 17 source code from the git repository and install it:</p>
<pre><code># git clone https://www.github.com/odoo/odoo --depth 1 --branch 18.0 /opt/odoo/odoo</code></pre>
<p>Next run the following command to generate a new Python virtual environment.</p>
<pre><code># python3 -m venv odoo-env</code></pre>
<p>Activate the virtual environment with the following command:</p>
<pre><code># source odoo-env/bin/activate</code></pre>
<p>Then install the required Python packages:</p>
<pre><code>(odoo-env) $ pip3 install wheel
(odoo-env) $ pip3 install -r odoo/requirements.txt</code></pre>
<p>After completing the process of installing all requirements to deactivate the virtual environment run the following command:</p>
<pre><code>(odoo-env) $ deactivate</code></pre>
<p>Execute the following command to create a directory for custom addons:</p>
<pre><code># mkdir /opt/odoo/custom-addons</code></pre>
<p>Next exit from the Odoo user:</p>
<pre><code># exit</code></pre>
<p>Create an <code>Odoo</code> log directory and provide it the required write permissions.</p>
<pre><code># mkdir /var/log/odoo18
# chown odoo:odoo /var/log/odoo18</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 7: Create Odoo Configuration File</span></h2>
<p>Create the <code>Odoo</code> configuration file.</p>
<pre><code># nano /etc/odoo.conf</code></pre>
<p>Then paste the following configuration into it.</p>
<pre><code>[options]
admin_passwd = Strong_admin_Password
db_host = False
db_port = False
db_user = odoo
db_password = False
logfile = /var/log/odoo18/odoo-server.log
addons_path = /opt/odoo/odoo/addons,/opt/odoo/custom-addons
xmlrpc_port = 8069</code></pre>
<p>Remember to update the value of the &#8220;<strong><code>Strong_admin_Password</code></strong>&#8221; key above with a more secure password.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 8: Create a Systemd Service File</span></h2>
<p>Create a systemd service file to manage the <code>Odoo</code> service:</p>
<pre><code># nano /etc/systemd/system/odoo.service</code></pre>
<p>Paste the following content into the <code>odoo.service</code> file:</p>
<pre><code>[Unit]
Description=Odoo
Requires=postgresql.service
After=network.target postgresql.service

[Service]
Type=simple
SyslogIdentifier=odoo
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo-env/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target</code></pre>
<p>Reload system daemon and start the service:</p>
<pre><code># systemctl daemon-reload
# systemctl start odoo
# systemctl enable odoo</code></pre>
<p>To confirm everything is working normally, check the status of service:</p>
<pre><code># systemctl status odoo</code></pre>
<p>Output:</p>
<pre><code>● odoo.service - Odoo
     Loaded: loaded (/etc/systemd/system/odoo.service; enabled; preset: enabled)
     Active: active (running)
   Main PID: 21764 (python3)
      Tasks: 4 (limit: 2218)
     Memory: 73.3M (peak: 73.5M)
        CPU: 973ms
     CGroup: /system.slice/odoo.service
             └─21764 /opt/odoo/odoo-env/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf
</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 9: Access Odoo 18 server</span></h2>
<p>Open your web browser and type <strong>http://your-IP-address:8069</strong> and you will see the following screen:</p>
<p><img decoding="async" class="aligncenter size-large wp-image-1811" src="https://www.linuxtuto.com/wp-content/uploads/2024/10/odoo18-900x393.webp" alt="Odoo 18" width="900" height="393" srcset="https://www.linuxtuto.com/wp-content/uploads/2024/10/odoo18-900x393.webp 900w, https://www.linuxtuto.com/wp-content/uploads/2024/10/odoo18-300x131.webp 300w, https://www.linuxtuto.com/wp-content/uploads/2024/10/odoo18-768x335.webp 768w, https://www.linuxtuto.com/wp-content/uploads/2024/10/odoo18-1536x670.webp 1536w, https://www.linuxtuto.com/wp-content/uploads/2024/10/odoo18-1222x533.webp 1222w, https://www.linuxtuto.com/wp-content/uploads/2024/10/odoo18-897x392.webp 897w, https://www.linuxtuto.com/wp-content/uploads/2024/10/odoo18-684x299.webp 684w, https://www.linuxtuto.com/wp-content/uploads/2024/10/odoo18.webp 1913w" sizes="(max-width: 900px) 100vw, 900px" /></p>
<h2><span class="has-inline-color has-vivid-purple-color">Comments and Conclusion</span></h2>
<p>That’s it. You have successfully installed Community version of Odoo 18 on Ubuntu 24.04.</p>
<p>For additional help or useful information, we recommend you to check  <a href="https://www.odoo.com/documentation/18.0/" target="_blank" rel="noopener">the official Odoo 18 documentation.</a></p>
<p>If you have any questions please leave a comment below.</p>
<p>The post <a href="https://www.linuxtuto.com/how-to-install-odoo-18-on-ubuntu-24-04/">How to Install Odoo 18 on Ubuntu 24.04</a> appeared first on <a href="https://www.linuxtuto.com">LinuxTuto</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxtuto.com/how-to-install-odoo-18-on-ubuntu-24-04/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1808</post-id>	</item>
		<item>
		<title>How to Install Odoo 17 on Debian 12</title>
		<link>https://www.linuxtuto.com/how-to-install-odoo-17-on-debian-12/</link>
					<comments>https://www.linuxtuto.com/how-to-install-odoo-17-on-debian-12/#comments</comments>
		
		<dc:creator><![CDATA[LinuxTuto]]></dc:creator>
		<pubDate>Mon, 13 Nov 2023 17:33:31 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Odoo]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://www.linuxtuto.com/?p=1599</guid>

					<description><![CDATA[<p>Odoo is an open-source suite of business management software applications that encompasses a wide range of business needs, including customer relationship management (CRM), sales, project...</p>
<p>The post <a href="https://www.linuxtuto.com/how-to-install-odoo-17-on-debian-12/">How to Install Odoo 17 on Debian 12</a> appeared first on <a href="https://www.linuxtuto.com">LinuxTuto</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Odoo is an open-source suite of business management software applications that encompasses a wide range of business needs, including customer relationship management (CRM), sales, project management, inventory management, manufacturing, financial management, and more.</p>
<p>It is widely used by businesses of various sizes and across different industries to streamline their operations, improve productivity, and manage their business processes more efficiently. Its flexibility, scalability, and cost-effectiveness make it a popular choice for organizations seeking comprehensive business management solutions.</p>
<p>In this tutorial, we will show you how to install Odoo 17 on Debian 12 OS.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 1: Update Operating System</span></h2>
<p>Update your <strong>Debian 12</strong> operating system to make sure all existing packages are up to date:</p>
<pre><code># apt update &amp;&amp; apt upgrade</code></pre>
<p>Then install all the required packages for the Odoo 17 setup on the Debian 12 OS.</p>
<pre><code># apt install python3 python3-dev python3-pip python3-venv python3-setuptools build-essential libzip-dev libxslt1-dev libldap2-dev python3-wheel libsasl2-dev node-less libjpeg-dev xfonts-75dpi xfonts-base libpq-dev libffi-dev fontconfig git wget nodejs npm</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 2: Install PostgreSQL </span></h2>
<p>Odoo uses PostgreSQL as a database backend, so you will need to <a href="https://www.linuxtuto.com/how-to-install-postgresql-15-on-debian-11/">install PostgreSQL</a> on your server.</p>
<p>You can run the following command to install the PostgreSQL server:</p>
<pre><code># apt-get install postgresql-15</code></pre>
<p>After the successful installation, start the PostgreSQL service and enable it to start after the system reboot:</p>
<pre><code># systemctl start postgresql
# systemctl enable postgresql</code></pre>
<p>Verify that is active and running on your server:</p>
<pre><code># systemctl status postgresql</code></pre>
<pre><strong>Output</strong>
<code>● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; preset: enabled)
     Active: active (exited)
   Main PID: 18666 (code=exited, status=0/SUCCESS)
        CPU: 2ms</code></pre>
<p>Now create an Odoo user in PostgreSQL:</p>
<pre><code># su - postgres -c "createuser -s odoo" </code></pre>
<p>This will add a new role <strong>odoo</strong> in the PostgreSQL server.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 3: Install Node.js</span></h2>
<p>To install Node.js and npm on your Debian OS use the following command:</p>
<pre><code># apt install nodejs npm</code></pre>
<p>Also, install the following module to enable RTL support:</p>
<pre><code># npm install -g rtlcss</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 4: Installation of wkhtmltox</span></h2>
<p>To generate PDF reports successfully, wkhtmltopdf is necessary. PDF reports are a crucial component of any organization.</p>
<p>First install the xfonts dependency before installing wkhtmltopdf:</p>
<pre><code># apt-get install xfonts-75dpi xfonts-base</code></pre>
<p>Now download and install wkhtmltopdf using the following commands:</p>
<pre><code># wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb
# dpkg -i wkhtmltox_0.12.6.1-3.bookworm_amd64.deb</code></pre>
<p>Verify if the wkhtmltopdf installation is successful by checking the version:</p>
<pre><code># wkhtmltopdf --version
wkhtmltopdf 0.12.6.1 (with patched qt)</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 5: Create an Odoo User</span></h2>
<p>Create a new system user for managing the Odoo processes on the Odoo server.</p>
<pre><code># adduser --system --group --home=/opt/odoo --shell=/bin/bash odoo</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 6: Install Odoo</span></h2>
<p>Switch to the user that you have created before to avoid encountering issues related to access rights.</p>
<pre><code># su - odoo</code></pre>
<p>Now, download the Odoo 17 source code from the git repository and install it:</p>
<pre><code># git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 /opt/odoo/odoo</code></pre>
<p>Next run the following command to generate a new Python virtual environment.</p>
<pre><code># python3 -m venv odoo-env</code></pre>
<p>Activate the virtual environment with the following command:</p>
<pre><code># source odoo-env/bin/activate</code></pre>
<p>Then install the required Python packages:</p>
<pre><code>(odoo-env) $ pip3 install wheel
(odoo-env) $ pip3 install -r odoo/requirements.txt</code></pre>
<p>After completing the process of installing all requirements to deactivate the virtual environment run the following command:</p>
<pre><code>(odoo-env) $ deactivate</code></pre>
<p>Execute the following command to create a directory for custom addons:</p>
<pre><code># mkdir /opt/odoo/custom-addons</code></pre>
<p>Next exit from the Odoo user:</p>
<pre><code># exit</code></pre>
<p>Create an <code>Odoo</code> log directory and provide it the required write permissions.</p>
<pre><code># mkdir /var/log/odoo
# chown odoo:odoo /var/log/odoo</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 7: Create Odoo Configuration File</span></h2>
<p>Create the <code>Odoo</code> configuration file.</p>
<pre><code># nano /etc/odoo.conf</code></pre>
<p>Then paste the following configuration into it.</p>
<pre><code>[options]
admin_passwd = Strong_admin_Password
db_host = False
db_port = False
db_user = odoo
db_password = False
logfile = /var/log/odoo/odoo-server.log
addons_path = /opt/odoo/odoo/addons,/opt/odoo/custom-addons
xmlrpc_port = 8069</code></pre>
<p>Remember to update the value of the &#8220;<strong><code>Strong_admin_Password</code></strong>&#8221; key above with a more secure password.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 8: Create a Systemd Service File</span></h2>
<p>Create a systemd service file to manage the <code>Odoo</code> service:</p>
<pre><code># nano /etc/systemd/system/odoo.service</code></pre>
<p>Paste the following content into the <code>odoo.service</code> file:</p>
<pre><code>[Unit]
Description=Odoo
Requires=postgresql.service
After=network.target postgresql.service

[Service]
Type=simple
SyslogIdentifier=odoo
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo-env/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target</code></pre>
<p>Reload system daemon and start the service:</p>
<pre><code># systemctl daemon-reload
# systemctl start odoo
# systemctl enable odoo</code></pre>
<p>To confirm everything is working normally, check the status of service:</p>
<pre><code># systemctl status odoo</code></pre>
<p>Output:</p>
<pre><code>● odoo.service - Odoo
     Loaded: loaded (/etc/systemd/system/odoo.service; enabled; preset: enabled)
     Active: active (running)
   Main PID: 2270 (python3)
      Tasks: 4 (limit: 2273)
     Memory: 110.0M
        CPU: 1.622s
     CGroup: /system.slice/odoo.service
             └─2270 /opt/odoo/odoo-env/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf
</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 9: Access Odoo server</span></h2>
<p>Open your web browser and type <strong>http://your-IP-address:8069</strong> and you will see the following screen:</p>
<p><img decoding="async" class="aligncenter size-large wp-image-1612" src="https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_create_database-900x444.webp" alt="Odoo 17 Create Database Page" width="900" height="444" srcset="https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_create_database-900x444.webp 900w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_create_database-300x148.webp 300w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_create_database-768x379.webp 768w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_create_database-1536x758.webp 1536w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_create_database-1222x603.webp 1222w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_create_database-897x443.webp 897w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_create_database-684x338.webp 684w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_create_database.webp 1914w" sizes="(max-width: 900px) 100vw, 900px" /></p>
<p>Fill the required information and then click the <strong>“Create Database”</strong> button to complete the installation.</p>
<p>After successfully creating the <code>Odoo</code> database, you will be redirected to the login page.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1613" src="https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_login_page-900x389.webp" alt="Odoo 17 login page" width="900" height="389" srcset="https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_login_page-900x389.webp 900w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_login_page-300x130.webp 300w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_login_page-768x332.webp 768w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_login_page-1536x664.webp 1536w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_login_page-1222x529.webp 1222w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_login_page-897x388.webp 897w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_login_page-684x296.webp 684w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_login_page.webp 1914w" sizes="auto, (max-width: 900px) 100vw, 900px" /></p>
<p>Enter your login credentials and you will be redirected to apps page:</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1615" src="https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_dashboard-900x512.webp" alt="Odoo Dashboard" width="900" height="512" srcset="https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_dashboard-900x512.webp 900w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_dashboard-300x171.webp 300w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_dashboard-768x437.webp 768w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_dashboard-1536x874.webp 1536w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_dashboard-1222x695.webp 1222w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_dashboard-897x510.webp 897w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_dashboard-684x389.webp 684w, https://www.linuxtuto.com/wp-content/uploads/2023/11/odoo17_dashboard.webp 1899w" sizes="auto, (max-width: 900px) 100vw, 900px" /></p>
<h2><span class="has-inline-color has-vivid-purple-color">Comments and Conclusion</span></h2>
<p>That’s it. You have successfully installed Odoo 17 on Debian 12. For additional information, you can check <a href="https://www.odoo.com/documentation/17.0/" target="_blank" rel="noopener">the official Odoo 17 documentation</a>.</p>
<p>If you have any questions please leave a comment below.</p>
<p>The post <a href="https://www.linuxtuto.com/how-to-install-odoo-17-on-debian-12/">How to Install Odoo 17 on Debian 12</a> appeared first on <a href="https://www.linuxtuto.com">LinuxTuto</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxtuto.com/how-to-install-odoo-17-on-debian-12/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1599</post-id>	</item>
		<item>
		<title>How to Install Strapi with Nginx on Debian 12</title>
		<link>https://www.linuxtuto.com/how-to-install-strapi-with-nginx-on-debian-12/</link>
					<comments>https://www.linuxtuto.com/how-to-install-strapi-with-nginx-on-debian-12/#comments</comments>
		
		<dc:creator><![CDATA[LinuxTuto]]></dc:creator>
		<pubDate>Tue, 08 Aug 2023 12:00:03 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Strapi]]></category>
		<guid isPermaLink="false">https://www.linuxtuto.com/?p=1499</guid>

					<description><![CDATA[<p>Strapi is a most advanced open source content management system (CMS) designed to help developers to build powerful API. Strapi follows a &#8220;headless&#8221; architecture, which...</p>
<p>The post <a href="https://www.linuxtuto.com/how-to-install-strapi-with-nginx-on-debian-12/">How to Install Strapi with Nginx on Debian 12</a> appeared first on <a href="https://www.linuxtuto.com">LinuxTuto</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Strapi is a most advanced open source content management system (CMS) designed to help developers to build powerful API.</p>
<p>Strapi follows a &#8220;headless&#8221; architecture, which means it separates the content management backend from the frontend presentation, giving developers the freedom to use various technologies and frameworks on the frontend.</p>
<p>In this tutorial, we will show you how to install <code>Strapi</code> on Debian 12 OS.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 1: Update Operating System</span></h2>
<p>Update your <strong>Debian 12</strong> operating system to make sure all existing packages are up to date:</p>
<pre><code># apt update &amp;&amp; apt upgrade</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 2: Install Nginx webserver</span></h2>
<p>You can install Nginx via <code>apt</code> package manager by executing the following command.</p>
<pre><code># apt install nginx</code></pre>
<p>You can start the Nginx service and configure it to run on startup by entering the following commands:</p>
<pre><code># systemctl start nginx
# systemctl enable nginx</code></pre>
<p>Verify the status of the Nginx service using <strong>systemctl status</strong> command:</p>
<pre><code># systemctl status nginx</code></pre>
<p>Output:</p>
<pre><code>● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; preset: enabled)
     Active: active (running)
       Docs: man:nginx(8)
    Process: 627 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 646 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 655 (nginx)
      Tasks: 2 (limit: 2273)
     Memory: 3.8M
        CPU: 27ms
     CGroup: /system.slice/nginx.service
             ├─655 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;"
             └─656 "nginx: worker process"</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 3: Install Node.js</span></h2>
<p>Strapi is based on Node.js, for that reason, you need to have Node.js installed on your server.</p>
<p>To install Node.js and npm on your Debian OS use the following command:</p>
<pre><code># apt install nodejs npm</code></pre>
<p>You can verify the Node.js version with the following command:</p>
<pre><code># node --version</code></pre>
<p>You should see the following output:</p>
<pre><code>v18.13.0</code></pre>
<p>Also, verify the <strong>npm</strong> version with the following command:</p>
<pre><code># npm --version</code></pre>
<p>You should get the following output:</p>
<pre><code>9.2.0</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 4: Install PostgreSQL </span></h2>
<p>Strapi uses PostgreSQL as a database backend, so you will need to<a href="https://www.linuxtuto.com/how-to-install-postgresql-15-on-debian-11/"> install PostgreSQL on your server</a>.</p>
<p>You can run the following command to install the PostgreSQL server:</p>
<pre><code># apt-get install postgresql-15</code></pre>
<p>After the successful installation, start the PostgreSQL service and enable it to start after the system reboot:</p>
<pre><code># systemctl start postgresql
# systemctl enable postgresql</code></pre>
<p>Verify that is active and running on your server:</p>
<pre><code># systemctl status postgresql</code></pre>
<pre><strong>Output</strong>
<code>● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; preset: enabled)
     Active: active (exited)
   Main PID: 13153 (code=exited, status=0/SUCCESS)
        CPU: 1ms
</code></pre>
<p>Next, connect to the PostgreSQL shell:</p>
<pre><code># su postgres
# psql</code></pre>
<p>Then, we create the Strapi database:</p>
<pre><code>postgres=# CREATE DATABASE strapidb; 
postgres=# CREATE USER strapi WITH PASSWORD 'Your-Strong-Password'; 
postgres=# GRANT ALL PRIVILEGES ON DATABASE strapidb to strapi; 
postgres=# \q</code></pre>
<p>Return to your <code>root</code> user account.</p>
<pre><code># exit</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 5: Create a Strapi Application</span></h2>
<p>Once PostgreSQL and Node.js have been installed, we can proceed to install Strapi.</p>
<p>You can use the <strong>npx</strong> command line utility to easily create a Strapi app.</p>
<pre><code># cd /opt
# npx create-strapi-app@latest strapi --no-run</code></pre>
<p>You will see the following output.</p>
<pre><code>Need to install the following packages:
  create-strapi-app@4.12.1
Ok to proceed? (y) <strong>y</strong></code></pre>
<p>Proceed with the creation by pressing <strong>y</strong>.</p>
<p>In the interactive shell, select <strong>custom</strong> installation then your database client, database name and user name as provisioned.</p>
<pre><code>? Choose your installation type Custom (manual settings)
? Choose your preferred language JavaScript
? Choose your default database client postgres
? Database name: strapidb
? Host: 127.0.0.1
? Port: 5432
? Username: strapi
? Password: ********************
? Enable SSL connection: No</code></pre>
<p>Next, navigate to the <strong>strapi</strong> directory and build the application with the following command.</p>
<pre><code># cd strapi
# npm run build</code></pre>
<p>Output:</p>
<pre><code>&gt; strapi@0.1.0 build
&gt; strapi build

Building your admin UI with development configuration...

✔ Webpack
  Compiled successfully in 1.12m

Admin UI built successfully
</code></pre>
<p>Then run Strapi in development mode.</p>
<pre><code># npm run develop</code></pre>
<p>If everything is fine, you will get the following output.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1503" src="https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_project_information.webp" alt="Strapi Project Information" width="900" height="427" srcset="https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_project_information.webp 900w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_project_information-300x142.webp 300w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_project_information-768x364.webp 768w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_project_information-897x426.webp 897w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_project_information-684x325.webp 684w" sizes="auto, (max-width: 900px) 100vw, 900px" /><br />
Press the <strong>CTRL+C</strong> to stop the application.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 6: Run Strapi with PM2</span></h2>
<p>In this step we will describe you to how to run Strapi app with PM2 command. PM2 is a Production Process Manager for Node.js applications.</p>
<p>First, install PM2 application by running the following command:</p>
<pre><code># npm install pm2@latest -g</code></pre>
<p>Now create a pm2 ecosystem file which is where you can setup some environment variables for each pm2 app you want to install and run.</p>
<pre><code># nano /root/ecosystem<span class="hljs-selector-class">.config</span><span class="hljs-selector-class">.js</span>
</code></pre>
<p>Paste the following content in the file.</p>
<pre><code>module.exports = {
  apps: [
    {
      name: <span class="hljs-string">'strapi'</span>,
      cwd: <span class="hljs-string">'/opt/strapi'</span>,
      script: <span class="hljs-string">'npm'</span>,
      args: <span class="hljs-string">'start'</span>,
      env: {
        NODE_ENV: <span class="hljs-string">'production'</span>,
        DATABASE_HOST: <span class="hljs-string">'localhost'</span>,
        DATABASE_PORT: <span class="hljs-string">'5432'</span>,
        DATABASE_NAME: <span class="hljs-string">'strapidb'</span>,
        DATABASE_USERNAME: <span class="hljs-string">'strapi'</span>,
        DATABASE_PASSWORD: <span class="hljs-string">'Your-Strong-Password'</span>
      },
    },
  ]
};
</code></pre>
<p><strong><span style="color: #ff0000;">Note:</span> /opt/strapi </strong>is the path to your project, you are required to replace this with your own path before you proceed.</p>
<p>Once modified, save the file then start the app in the background with the command:</p>
<pre><code># pm2 start /root/ecosystem.config.js</code></pre>
<p>You can see that the status of the app is set to <code>online</code>.</p>
<pre><code># pm2 list</code></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1506" src="https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_pm2_list-900x59.webp" alt="pm2 list" width="900" height="59" srcset="https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_pm2_list-900x59.webp 900w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_pm2_list-300x20.webp 300w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_pm2_list-768x50.webp 768w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_pm2_list-1536x100.webp 1536w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_pm2_list-1222x80.webp 1222w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_pm2_list-897x59.webp 897w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_pm2_list-684x45.webp 684w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_pm2_list.webp 1622w" sizes="auto, (max-width: 900px) 100vw, 900px" /></p>
<p>To allow the app to start automatically on boot, use the command:</p>
<pre><code># pm2 startup -u root</code></pre>
<p>Save the process:</p>
<pre><code># pm2 save</code></pre>
<p>Your <code>Strapi</code> service is now running in the background in production mode.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 7: Configure Nginx for Strapi</span></h2>
<p>Create a new Nginx virtual host configuration file.</p>
<pre><code># nano /etc/nginx/conf.d/strapi.conf</code></pre>
<p>Add the following configurations:</p>
<pre><code>upstream strapi {
server 127.0.0.1:1337;
}

server {

listen 80;
server_name your-domain.com www.your-domain.com;

location / {
        proxy_pass http://strapi;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $http_host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_pass_request_headers on;
      }
}</code></pre>
<p>Save and close the file, then edit the Nginx main configuration file.</p>
<pre><code># nano /etc/nginx/nginx.conf</code></pre>
<p>Add the following line after the line <code>http{:</code> but before the line <code>include /etc/nginx/conf.d/*.conf;</code>.</p>
<pre><code>server_names_hash_bucket_size 64;</code></pre>
<p>Save the file, then verify the Nginx configuration.</p>
<pre><code># /usr/sbin/nginx -t</code></pre>
<p>You should see the following output:</p>
<pre><code>nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful</code></pre>
<p>Restart the Nginx service to implement the changes.</p>
<pre><code># systemctl restart nginx</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 8: Access Strapi Web Interface</span></h2>
<p>Now, open your web browser and access the Strapi web UI using the URL <strong>http://your-domain.com/admin.</strong> You should see the <code>Strapi</code> default page:</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1500" src="https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_welcome_page-900x513.webp" alt="Strapi Welcome Page" width="900" height="513" srcset="https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_welcome_page-900x513.webp 900w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_welcome_page-300x171.webp 300w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_welcome_page-768x438.webp 768w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_welcome_page-1536x876.webp 1536w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_welcome_page-1222x697.webp 1222w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_welcome_page-897x511.webp 897w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_welcome_page-684x390.webp 684w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_welcome_page.webp 1894w" sizes="auto, (max-width: 900px) 100vw, 900px" /></p>
<p>Then click on the <strong>Let’s start</strong> button. You should see the <code>Strapi</code> dashboard:</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1501" src="https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_dashboard-900x513.webp" alt="Strapi Dashboard" width="900" height="513" srcset="https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_dashboard-900x513.webp 900w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_dashboard-300x171.webp 300w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_dashboard-768x438.webp 768w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_dashboard-1536x876.webp 1536w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_dashboard-1222x697.webp 1222w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_dashboard-897x512.webp 897w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_dashboard-684x390.webp 684w, https://www.linuxtuto.com/wp-content/uploads/2023/08/strapi_dashboard.webp 1890w" sizes="auto, (max-width: 900px) 100vw, 900px" /></p>
<h2><span class="has-inline-color has-vivid-purple-color">Comments and Conclusion</span></h2>
<p>Congratulations. You have learned how to install Strapi on Debian 12 OS. You can now create your own application easily using Strapi.</p>
<p>For additional help or useful information, we recommend you to check  <a href="https://docs.strapi.io/" target="_blank" rel="noopener">the official Strapi documentation.</a></p>
<p>The post <a href="https://www.linuxtuto.com/how-to-install-strapi-with-nginx-on-debian-12/">How to Install Strapi with Nginx on Debian 12</a> appeared first on <a href="https://www.linuxtuto.com">LinuxTuto</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxtuto.com/how-to-install-strapi-with-nginx-on-debian-12/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1499</post-id>	</item>
		<item>
		<title>How to Install PostgreSQL 15 on Debian 11</title>
		<link>https://www.linuxtuto.com/how-to-install-postgresql-15-on-debian-11/</link>
					<comments>https://www.linuxtuto.com/how-to-install-postgresql-15-on-debian-11/#respond</comments>
		
		<dc:creator><![CDATA[LinuxTuto]]></dc:creator>
		<pubDate>Mon, 17 Oct 2022 15:00:25 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<guid isPermaLink="false">https://www.linuxtuto.com/?p=544</guid>

					<description><![CDATA[<p>PostgreSQL also known as Postgres, is a free and open source object-relational database system that runs on Client-Server architecture. It is one of the leading...</p>
<p>The post <a href="https://www.linuxtuto.com/how-to-install-postgresql-15-on-debian-11/">How to Install PostgreSQL 15 on Debian 11</a> appeared first on <a href="https://www.linuxtuto.com">LinuxTuto</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>PostgreSQL also known as Postgres, is a free and open source object-relational database system that runs on Client-Server architecture. It is one of the leading database servers used for production servers. DevOps use it as an alternative to <a href="https://www.linuxtuto.com/how-to-install-mariadb-10-7-on-debian-11/">MariaDB</a>.</p>
<p>In this guide we are going to install PostgreSQL 15 in Debian 11.</p>
<h2><span class="has-inline-color has-vivid-purple-color">1. Update Operating System</span></h2>
<p>Update your <strong>Debian 11</strong> operating system to make sure all existing packages are up to date:</p>
<pre><code># apt update &amp;&amp; sudo apt upgrade -y</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">2. Install PostgreSQL 15 using the official repository</span></h2>
<p>PostgreSQL is available in the default Debian repositories but the available versions are not up to date.</p>
<p>To get the latest packages of PostgreSQL, you must add the <a href="https://www.postgresql.org/download/linux/debian/">official repo of PostgreSQL</a>.</p>
<p>First, install all required dependencies by running the following command:</p>
<pre><code># apt-get install wget sudo curl gnupg2 -y</code></pre>
<p>After installing all the dependencies, create the file repository configuration with the following command:</p>
<pre><code># sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" &gt; /etc/apt/sources.list.d/pgdg.list'</code></pre>
<p>Now import the repository signing key by using the following command:</p>
<pre><code># wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -</code></pre>
<p>Update your local package index with the following command:</p>
<pre><code># apt -y update</code></pre>
<p>Now you can run the following command to install the latest version of the PostgreSQL server:</p>
<pre><code># apt-get install postgresql-15 -y</code></pre>
<p>After the successful installation, start the PostgreSQL service and enable it to start after the system reboot:</p>
<pre><code># systemctl start postgresql
# systemctl enable postgresql</code></pre>
<p>Verify that is active and running on your server:</p>
<pre><code># systemctl status postgresql</code></pre>
<pre><strong>Output</strong>
<code>● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
     Active: active (exited)
   Main PID: 7543 (code=exited, status=0/SUCCESS)
      Tasks: 0 (limit: 2300)
     Memory: 0B
        CPU: 0
     CGroup: /system.slice/postgresql.service
</code></pre>
<p>By default, PostgreSQL listens on port <strong>5432</strong>. You can check it with the following command:</p>
<pre><code># ss -antpl | grep 5432</code></pre>
<p>You will get the PostgreSQL listening port in the following output:</p>
<pre><code>LISTEN 0      244             127.0.0.1:5432       0.0.0.0:*    users:(("postgres",pid=7525,fd=6))
LISTEN 0      244                 [::1]:5432          [::]:*    users:(("postgres",pid=7525,fd=5))</code></pre>
<p>You can also check the version using the following command:</p>
<pre><code># sudo -u postgres psql -c "SELECT version();"</code></pre>
<p>You will get the version in the following output:</p>
<pre><code>                                                           version
-----------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 15.0 (Debian 15.0-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
(1 row)</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">3. Logging into PostgreSQL</span></h2>
<p>To access your PostgreSQL server, you must log in as a Postgres user. To do this run the following command:</p>
<pre><code># su postgres</code></pre>
<p>Now you can access your PostgreSQL shell with the following command:</p>
<pre><code>$ psql</code></pre>
<p>In your output you will see:</p>
<pre><strong>Output</strong>
<code>psql (15.0 (Debian 15.0-1.pgdg110+1))
Type "help" for help.

postgres=#</code></pre>
<p>Once you have accessed the command shell of Postgres, you can now use SQL queries to perform several database-related operations.</p>
<p>To set the Postgres pasword, run the following command:</p>
<pre><code>ALTER USER postgres PASSWORD 'password';</code></pre>
<p>To create a database named <code><strong>test</strong></code>, run the following command:</p>
<pre><code>CREATE DATABASE test;</code></pre>
<p>To list all databases, run the following command:</p>
<pre><code>\l</code></pre>
<p>You should see all databases in the following output:</p>
<p><img loading="lazy" decoding="async" class="size-large wp-image-730 aligncenter" src="https://www.linuxtuto.com/wp-content/uploads/2022/09/list_of_databases-1024x228.jpg" alt="List of databases PostgreSQL" width="1024" height="228" srcset="https://www.linuxtuto.com/wp-content/uploads/2022/09/list_of_databases-1024x228.jpg 1024w, https://www.linuxtuto.com/wp-content/uploads/2022/09/list_of_databases-300x67.jpg 300w, https://www.linuxtuto.com/wp-content/uploads/2022/09/list_of_databases-768x171.jpg 768w, https://www.linuxtuto.com/wp-content/uploads/2022/09/list_of_databases-897x200.jpg 897w, https://www.linuxtuto.com/wp-content/uploads/2022/09/list_of_databases-684x152.jpg 684w, https://www.linuxtuto.com/wp-content/uploads/2022/09/list_of_databases.jpg 1032w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<p>To switch the database to <strong><code>test</code></strong>, run the following command:</p>
<pre><code>\c test</code></pre>
<p>To create a table (e.g <code>accounts</code>), run the following command:</p>
<pre><code>CREATE TABLE accounts (
	user_id serial PRIMARY KEY,
	username VARCHAR ( 50 ) UNIQUE NOT NULL,
	password VARCHAR ( 50 ) NOT NULL,
	email VARCHAR ( 255 ) UNIQUE NOT NULL,
	created_on TIMESTAMP NOT NULL,
        last_login TIMESTAMP 
);</code></pre>
<p>To list all tables, run the following command:</p>
<pre><code>\dt</code></pre>
<p>You should see all tables in the following output:</p>
<pre><code>          List of relations
 Schema |   Name   | Type  |  Owner
--------+----------+-------+----------
 public | accounts | table | postgres
(1 row)</code>&lt;</pre>
<p>To exit from the shell, run the following command:</p>
<pre><code>exit</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">4. Backup and Restore a Single Database</span></h2>
<p>You can back up and restore a single database using the <code><strong>pg_dump</strong></code> utility.</p>
<p>For example, to back up a single database named <code>test</code> and generate a backup file named <code>test_backup.sql</code>, run the following command:</p>
<pre><code>su - postgres
pg_dump -d test -f test_backup.sql</code></pre>
<p>You can also restore a single database using <code><strong>psql</strong></code> command.</p>
<p>For example, to restore a single database named <code>test</code> from a backup file named <code>test_backup.sql</code>, run the following command:</p>
<pre><code>su - postgres
psql -d test -f test_backup.sql</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Comments and Conclusion</span></h2>
<p>At this point, you learn to set up PostgreSQL 15 on Debian 11.  If you need more information, or have any questions, just comment below and we will be glad to assist you!</p>
<p>Check below for some of our other articles.</p>
<p>The post <a href="https://www.linuxtuto.com/how-to-install-postgresql-15-on-debian-11/">How to Install PostgreSQL 15 on Debian 11</a> appeared first on <a href="https://www.linuxtuto.com">LinuxTuto</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxtuto.com/how-to-install-postgresql-15-on-debian-11/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">544</post-id>	</item>
	</channel>
</rss>
