<?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>ubuntu18.04 Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/ubuntu18-04/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Thu, 21 Jun 2018 20:41:39 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.13</generator>
	<item>
		<title>How to install PostgreSql on Ubuntu18.04</title>
		<link>https://www.osradar.com/how-to-install-postgresql-on-ubuntu18-04/</link>
					<comments>https://www.osradar.com/how-to-install-postgresql-on-ubuntu18-04/#respond</comments>
		
		<dc:creator><![CDATA[Mel]]></dc:creator>
		<pubDate>Thu, 31 May 2018 08:11:05 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ubuntu18.04]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=3601</guid>

					<description><![CDATA[<p>Install and Use PostgreSQL on Ubuntu 18.04 Database management systems are the major components for websites and almost every application uses database to store their data as well as manage this data to produce different results for specific purpose. Basically database provide a structural way to organize and manage data to access information. Before starting [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-postgresql-on-ubuntu18-04/">How to install PostgreSql on Ubuntu18.04</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="text-align: center;"><strong>Install and Use PostgreSQL on Ubuntu 18.04</strong></p>
<p>Database management systems are the major components for websites and almost every application uses database to store their data as well as manage this data to produce different results for specific purpose. Basically database provide a structural way to organize and manage data to access information.</p>
<p>Before starting the installation of PostgreSQL on Ubuntu. Let’s have a description about this database. PostgreSQL is a relational database management system in which we use a system that provides the implementation of original SQL (Structure Query Language). PostgreSQL is the most popular choice which provides advanced features in which transactions are reliable data concurrency handles without read locks.</p>
<p>In this article we will learn how to install and use PostgreSQL in our Ubuntu server. So let’s start by the following steps.</p>
<h2>STEP1:  Installing PostgreSQL on Ubuntu.</h2>
<p>The first step for installing PostgreSQL on Ubuntu is to add repository files of Postgres packages into Ubuntu. Note that your server should be configured initially in which there is a non-root user and some basic firewall settings are configured. However, this is your first time, so refresh your local package and then install Postgres package. Following is the process to install the package by command.</p>
<p><strong>Command:  </strong></p>
<table>
<tbody>
<tr>
<td width="623"><strong> $  sudo apt update</strong></td>
</tr>
<tr>
<td width="623"><strong> $  sudo apt install postgresql postgresql-contrib</strong><strong> </strong></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><img loading="lazy" class=" td-modal-image aligncenter wp-image-3607 size-large" src="https://www.osradar.com/wp-content/uploads/2018/05/install-postgresql-1024x476.png" alt="" width="696" height="324" srcset="https://www.osradar.com/wp-content/uploads/2018/05/install-postgresql-1024x476.png 1024w, https://www.osradar.com/wp-content/uploads/2018/05/install-postgresql-300x139.png 300w, https://www.osradar.com/wp-content/uploads/2018/05/install-postgresql-768x357.png 768w, https://www.osradar.com/wp-content/uploads/2018/05/install-postgresql-696x323.png 696w, https://www.osradar.com/wp-content/uploads/2018/05/install-postgresql-1068x496.png 1068w, https://www.osradar.com/wp-content/uploads/2018/05/install-postgresql-904x420.png 904w, https://www.osradar.com/wp-content/uploads/2018/05/install-postgresql.png 1333w" sizes="(max-width: 696px) 100vw, 696px" /></p>
<p>After installing Postgres into Ubuntu server, then you have to check that whether it is listening to the socket on port number 5432. For this purpose, follow the command mentioned below:</p>
<p><strong>Command</strong>:</p>
<table>
<tbody>
<tr>
<td width="623"><strong>$ </strong><strong>ss -nlt</strong></td>
</tr>
</tbody>
</table>
<p>The server will start after the reboot completes. Then you can enable or disable this by using following commands.</p>
<p><img loading="lazy" class=" td-modal-image aligncenter wp-image-3606 size-large" src="https://www.osradar.com/wp-content/uploads/2018/05/chek-port-1024x481.png" alt="" width="696" height="327" srcset="https://www.osradar.com/wp-content/uploads/2018/05/chek-port-1024x481.png 1024w, https://www.osradar.com/wp-content/uploads/2018/05/chek-port-300x141.png 300w, https://www.osradar.com/wp-content/uploads/2018/05/chek-port-768x361.png 768w, https://www.osradar.com/wp-content/uploads/2018/05/chek-port-696x327.png 696w, https://www.osradar.com/wp-content/uploads/2018/05/chek-port-1068x502.png 1068w, https://www.osradar.com/wp-content/uploads/2018/05/chek-port-894x420.png 894w, https://www.osradar.com/wp-content/uploads/2018/05/chek-port.png 1245w" sizes="(max-width: 696px) 100vw, 696px" /></p>
<p><strong>Command</strong>:</p>
<table>
<tbody>
<tr>
<td width="623"><strong>$ sudo systemctl disable postgresql</strong></td>
</tr>
<tr>
<td width="623"><strong>OR</strong></td>
</tr>
<tr>
<td width="623"><strong>$ sudo systemctl enable postgresql</strong></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>To configure your server to listen all networks, then you have to change its main configuration file using following command.</p>
<p><strong>Command</strong>:</p>
<table>
<tbody>
<tr>
<td width="623"><strong>$ sudo nano /etc/postgresql/10/main/postgresql.conf</strong></td>
</tr>
</tbody>
</table>
<h2></h2>
<h2>Step 2: Listening and restarting PostgreSQL.</h2>
<p>After configuring Postgresql to listen for all networks, now we have to type the command to check whether it is listening or not. And then later we will restart the server. For this purpose, follow the instructions by typing the commands.</p>
<p><strong>Command: </strong></p>
<table>
<tbody>
<tr>
<td width="623"><strong>listen_addresses = &#8216;*&#8217;</strong></td>
</tr>
<tr>
<td width="623"><strong>$ sudo service postgresql restart</strong></td>
</tr>
</tbody>
</table>
<h2><img loading="lazy" class=" td-modal-image aligncenter wp-image-3602 size-large" src="https://www.osradar.com/wp-content/uploads/2018/05/ipaddress-1024x473.png" alt="" width="696" height="321" srcset="https://www.osradar.com/wp-content/uploads/2018/05/ipaddress-1024x473.png 1024w, https://www.osradar.com/wp-content/uploads/2018/05/ipaddress-300x138.png 300w, https://www.osradar.com/wp-content/uploads/2018/05/ipaddress-768x355.png 768w, https://www.osradar.com/wp-content/uploads/2018/05/ipaddress-696x321.png 696w, https://www.osradar.com/wp-content/uploads/2018/05/ipaddress-1068x493.png 1068w, https://www.osradar.com/wp-content/uploads/2018/05/ipaddress-910x420.png 910w, https://www.osradar.com/wp-content/uploads/2018/05/ipaddress.png 1226w" sizes="(max-width: 696px) 100vw, 696px" /></h2>
<h2>Note: If you have enabled UFW firewall, then you can open the server’s port5432 for any incoming traffic by following command</h2>
<p><strong>Command</strong>:</p>
<table>
<tbody>
<tr>
<td width="623"><strong>$ sudo ufw allow from any to any port 5432 proto tcp</strong></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h2>Step 3: Connecting to PostgreSQL.</h2>
<p>After installing and configuring the PostgreSQL in our server, now it is the time to connect this system to use it and create database, users etc. For connecting to PostgreSQL follow the commands or instruction accordingly to make it successful for you.</p>
<p><strong>Command</strong>:</p>
<table>
<tbody>
<tr>
<td width="623"><strong>$ sudo su &#8211; postgres</strong></td>
</tr>
<tr>
<td width="623"><strong>$ psql</strong></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h2>Step 4: Check lists of database in PostgreSQL.</h2>
<p>After connecting to the server we are now required to check whether there are databases in the server. For this purpose, perform following steps.</p>
<p><strong>Command</strong>:</p>
<table>
<tbody>
<tr>
<td width="623"><strong>postgres-# \l</strong></td>
</tr>
</tbody>
</table>
<p>This will give you following results:</p>
<p><img loading="lazy" class=" td-modal-image aligncenter wp-image-3603 size-full" src="https://www.osradar.com/wp-content/uploads/2018/05/list-databases.png" alt="" width="1299" height="593" srcset="https://www.osradar.com/wp-content/uploads/2018/05/list-databases.png 1299w, https://www.osradar.com/wp-content/uploads/2018/05/list-databases-300x137.png 300w, https://www.osradar.com/wp-content/uploads/2018/05/list-databases-768x351.png 768w, https://www.osradar.com/wp-content/uploads/2018/05/list-databases-1024x467.png 1024w, https://www.osradar.com/wp-content/uploads/2018/05/list-databases-696x318.png 696w, https://www.osradar.com/wp-content/uploads/2018/05/list-databases-1068x488.png 1068w, https://www.osradar.com/wp-content/uploads/2018/05/list-databases-920x420.png 920w" sizes="(max-width: 1299px) 100vw, 1299px" /></p>
<p>In order to list the users in the database type following steps or commands.</p>
<p><strong>Command</strong>:</p>
<table>
<tbody>
<tr>
<td width="623"><strong>postgres-# \du</strong></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><img loading="lazy" class=" td-modal-image aligncenter wp-image-3604 size-large" src="https://www.osradar.com/wp-content/uploads/2018/05/list-the-usesr-1024x462.png" alt="" width="696" height="314" srcset="https://www.osradar.com/wp-content/uploads/2018/05/list-the-usesr-1024x462.png 1024w, https://www.osradar.com/wp-content/uploads/2018/05/list-the-usesr-300x135.png 300w, https://www.osradar.com/wp-content/uploads/2018/05/list-the-usesr-768x347.png 768w, https://www.osradar.com/wp-content/uploads/2018/05/list-the-usesr-696x314.png 696w, https://www.osradar.com/wp-content/uploads/2018/05/list-the-usesr-1068x482.png 1068w, https://www.osradar.com/wp-content/uploads/2018/05/list-the-usesr-930x420.png 930w, https://www.osradar.com/wp-content/uploads/2018/05/list-the-usesr.png 1291w" sizes="(max-width: 696px) 100vw, 696px" /></p>
<h2>Step 5: Change user Password in PostgreSQL.</h2>
<p>After we have seen databases and users, now we can change user’s password by performing the following step.</p>
<p><strong>Command</strong>:</p>
<table>
<tbody>
<tr>
<td width="623"><strong>postgres=# ALTER USER postgres WITH PASSWORD  ‘newpass’;</strong></p>
<p><strong>ALTER ROLE</strong></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>For creating new user in database follow the below mentioned steps.</p>
<p><strong>Command</strong>:</p>
<table>
<tbody>
<tr>
<td width="623"><strong>postgres=# CREATE USER newuser WITH PASSWORD &#8216;123&#8217;;</strong></p>
<p><strong>CREATE ROLE</strong></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>After creating users now we can upgrade and check login info for the users. For this purpose follow the steps.</p>
<p><strong>Command</strong>:</p>
<table>
<tbody>
<tr>
<td width="623"><strong>postgres=# ALTER USER newuser WITH SUPERUSER;  (For upgrading user)</strong></p>
<p><strong>ALTER ROLE</strong></p>
<p><strong> </strong></td>
</tr>
<tr>
<td width="623"><strong>postgres-# \conninfo   (For log-in info)</strong></p>
<p><strong> </strong></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><img loading="lazy" class=" td-modal-image aligncenter wp-image-3605 size-large" src="https://www.osradar.com/wp-content/uploads/2018/05/adduser-adn-alter-1024x472.png" alt="" width="696" height="321" srcset="https://www.osradar.com/wp-content/uploads/2018/05/adduser-adn-alter-1024x472.png 1024w, https://www.osradar.com/wp-content/uploads/2018/05/adduser-adn-alter-300x138.png 300w, https://www.osradar.com/wp-content/uploads/2018/05/adduser-adn-alter-768x354.png 768w, https://www.osradar.com/wp-content/uploads/2018/05/adduser-adn-alter-696x320.png 696w, https://www.osradar.com/wp-content/uploads/2018/05/adduser-adn-alter-1068x492.png 1068w, https://www.osradar.com/wp-content/uploads/2018/05/adduser-adn-alter-912x420.png 912w, https://www.osradar.com/wp-content/uploads/2018/05/adduser-adn-alter.png 1227w" sizes="(max-width: 696px) 100vw, 696px" /></p>
<p>After this you can now exit the program by typing following command.</p>
<p><strong>Command</strong>:</p>
<table>
<tbody>
<tr>
<td width="623"><strong>postgres-# \q</strong></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h2>Conclusion:</h2>
<p>After following all the guideline, you are now able to install PostgreSQL in Ubuntu to use the features of PostgreSQL. And using this DBMS to manage and creating user. However, you should follow the same procedure to make it accurate. If you face any problem, then leave a message or comment. We will help you in every matter<strong>.</strong></p>
<p><strong> </strong></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-postgresql-on-ubuntu18-04/">How to install PostgreSql on Ubuntu18.04</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-install-postgresql-on-ubuntu18-04/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
