🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-and-use-postgresql-on-ubuntu-20-04
How To Install and Use PostgreSQL on Ubuntu | DigitalOcean
November 6, 2025 - The pg_createcluster command is the standard Ubuntu method for this. ... These are the most frequent issues users face after a successful installation. This is the most common error. It means you are trying to connect locally, and your currently logged-in Ubuntu username does not match the ...
🌐
Liquid Web
liquidweb.com › home › creating and deleting a postgresql database on ubuntu 16.04
Creating & Deleting a PostgreSQL Database on Ubuntu 16.04 | Liquid Web
August 23, 2024 - Let’s create our first database by typing in the command below. Replace dbname with the database name of your choice. ... Using the following command allows us to view the databases in our PostgreSQL instance (you can ignore, delete or utilize the default databases: postgres, template0, template1)
Discussions

Create database from command line in PostgreSQL - Stack Overflow
I am trying to create a database from command line. My OS is centos and postgres version is 10.9. sudo -u postgres psql createdb test Password for user test: Why is it prompting me for the password? More on stackoverflow.com
🌐 stackoverflow.com
Cannot create database in Ubuntu

I can give you two recommendations:

  1. go to WSL2

  2. install Postgres in Windows - this is preferable way because under WSL postgres works very very slow. You can run all your dev in WSL and db on host - it works flawless

More on reddit.com
🌐 r/PostgreSQL
15
0
April 10, 2022
Upgrade Ubuntu 22 to 24 Error : 'postgresql-16-postgis-3' is marked for removal but it's in the removal deny list
Hi everyone, I'm facing an issue while upgrading from Ubuntu 22 to 24. When I check the log using: cat /var/log/dist-upgrade/main.log I get the… More on reddit.com
🌐 r/Ubuntu
5
5
September 3, 2024
How to move Postgresql 14 databases to /home directory in Ubuntu 22.04?
Postgresql seems to store its data in /var/lib/postgresql. You can make a /home/postgresql and copy /var/lib/postgresql to that location. Also change the owner: chown postgres:postgres /var/lib/postgresql. After removing /var/lib/postgresql you can replace it with a symbolic link ln -s ../../home/postgresql /var/lib/postgresql since I don't if you can configure the directory in a setting. You can also change the home directory in /etc/passwd: usermod -d /home/postgresql postgresql, but it shouldn't be necessary with the symbolic link. More on reddit.com
🌐 r/linuxadmin
11
3
January 16, 2023
🌐
Ubuntu
manpages.ubuntu.com › manpages › bionic › man1 › createdb.1.html
Ubuntu Manpage: createdb - create a new PostgreSQL database
createdb creates a new PostgreSQL database. Normally, the database user who executes this command becomes the owner of the new database. However, a different owner can be specified via the -O option, if the executing user has appropriate privileges. createdb is a wrapper around the SQL command ...
🌐
Ubuntu
ubuntu.com › server › docs › how-to › databases › install-postgresql
Install and configure PostgreSQL - Ubuntu Server documentation
4 weeks ago - To test the replication you can now create a test database in the main server and check if it is replicated in the standby server: $ sudo -u postgres createdb test # on the main server
🌐
OVHcloud
ovhcloud.com › home › tutorials › how to install a postgresql database on ubuntu 22.04
How to install a PostgreSQL database on Ubuntu 22.04 ? | OVHcloud Worldwide
example=> CREATE TABLE first_table (id INT PRIMARY KEY NOT NULL, column1 CHAR(50)); CREATE TABLE example=> ... example=> INSERT INTO first_table (id, column1) VALUES (1, 'example'); example=> SELECT * FROM first_table; ... example=> INSERT INTO first_table (id, column1) VALUES (1, 'example'); ...
🌐
DEV Community
dev.to › caglarcercinli1 › how-to-create-a-postgresql-database-on-ubuntu-2004-49a0
HOW TO CREATE A POSTGRESQL DATABASE ON UBUNTU 20.04 - DEV Community
April 14, 2022 - #postgres #ubuntu · First open terminal and · sudo apt update sudo apt install postgresql postgresql-contrib · now you have downloaded necessary libraries. After that: sudo -i -u postgres · This way you are switched to postgres user. and ...
🌐
PostgreSQL
postgresql.org › docs › current › tutorial-createdb.html
PostgreSQL: Documentation: 18: 1.3. Creating a Database
May 14, 2026 - To create a new database from the command line, in this example named mydb, you use the following command: ... If this produces no response then this step was successful and you can skip over the remainder of this section. ... then PostgreSQL was not installed properly.
🌐
Medium
medium.com › coding-blocks › creating-user-database-and-adding-access-on-postgresql-8bfcd2f4a91e
Creating user, database and adding access on PostgreSQL | by Arnav Gupta | Coding Blocks | Medium
December 1, 2018 - NOTE: Right off the bat — this is valid as on March 2017, running on Ubuntu 16.04.2, with PostgreSQL 9.6 ... sudo -u postgres psql postgres=# create database mydb; postgres=# create user myuser with encrypted password 'mypass'; postgres=# ...
Find elsewhere
🌐
Ubuntu
manpages.ubuntu.com › manpages › trusty › man1 › createdb.1.html
Ubuntu Manpage: createdb - create a new Postgres-XC database
Note The following description applies both to Postgres-XC and PostgreSQL if not described explicitly. createdb creates a new Postgres-XC database. Normally, the database user who executes this command becomes the owner of the new database. However, a different owner can be specified via the ...
🌐
Linux Hint
linuxhint.com › install-and-setup-postgresql-database-ubuntu-22-04
How to Install and Set up PostgreSQL Database on Ubuntu 22.04 – Linux Hint
We have compiled the easiest method to install, set up, and uninstall PostgreSQL database on Ubuntu 22.04. To install and set up the PostgreSQL database, firstly update the system packages and execute the “$ sudo apt install postgresql postgresql-contrib” command for PostgreSQL installation.
🌐
CommandPrompt Inc.
commandprompt.com › education › how-to-install-postgresql-database-on-ubuntu
How to Install PostgreSQL Database on Ubuntu — CommandPrompt Inc.
November 28, 2022 - To install Postgres on your Ubuntu operating system, run the “sudo apt install postgresql postgresql -contrib” command. Installing Postgres will automatically install the SQL Shell on your system.
Address   2950 Newmarket ST STE 101 - 231, 98226, Bellingham
🌐
Cherry Servers
cherryservers.com › home › blog › postgresql › how to create a database in postgresql [create database, createdb]
How to create a database in PostgreSQL | Cherry Servers
November 7, 2025 - This step-by-step tutorial demonstrates how to create a database in PostgreSQL, using CREATE DATABASE or createdb command.
🌐
Medium
medium.com › @thomas.vidori › how-to-setup-a-new-postgresql-user-then-a-database-on-ubuntu-server-44a38362bad9
Setup a PostgreSQL user then a database on Ubuntu server | by Thomas Vidori | Medium
January 10, 2025 - Then restart PostgreSQL with: ... ... this user the admin of. To create a new database in SQL, connect to the PostgreSQL interface as a superuser using the command psql....
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-postgresql-on-ubuntu-20-04-quickstart
How To Install PostgreSQL on Ubuntu | DigitalOcean
October 27, 2025 - Create a PostgreSQL database in minutes and let DigitalOcean handle migrating your data, upgrades, maintenance, and security. ... You can install PostgreSQL on Ubuntu using the apt package manager.
🌐
TutorialsPoint
tutorialspoint.com › postgresql › postgresql_create_database.htm
PostgreSQL - CREATE Database
Go to the bin directory and execute the following command to create a database. createdb -h localhost -p 5432 -U postgres testdb password ******
🌐
DEV Community
dev.to › topeogunleye › how-to-install-postgresql-18-on-ubuntu-2404-1doc
How to Install PostgreSQL 18 on Ubuntu 24.04 - DEV Community
October 29, 2025 - Grant Privileges (Optional) You can grant specific privileges to a role either during its creation or afterward using the ALTER ROLE command. From your terminal, switch to a superuser account, for example: a postgres account because only a superuser can grant SUPERUSER status · Superuser Priviledge: You use the command below to bypass all permission checks for a user: ... Database Creation Privilege: You use the command below to allow the role to create new databases.