How To Install PostgreSQL on Ubuntu 22.04 LTS (Linux)

Sdílet
Vložit
  • čas přidán 6. 06. 2023
  • Are you looking to install PostgreSQL on your 22.04 LTS Linux machine but don't know where to start? In this tutorial, we'll guide you through the process step-by-step.
    Follow this step-by-step guide to learn how:
    1. Update System Packages:
    - Open a terminal on your Ubuntu system.
    - Run the following command to update the system packages:
    ```
    sudo apt update
    ```
    2. Install PostgreSQL:
    - Use the following command to install PostgreSQL and its dependencies:
    ```
    sudo apt install postgresql
    ```
    3. Verify PostgreSQL Installation:
    - After the installation is complete, PostgreSQL service will start automatically.
    - You can check the status of the service using the following command:
    ```
    sudo systemctl status postgresql
    ```
    4. Access PostgreSQL:
    - By default, PostgreSQL creates a system user called "postgres" during installation.
    - Switch to the "postgres" user using the following command:
    ```
    sudo su - postgres
    ```
    5. Access PostgreSQL Shell:
    - Once you are logged in as the "postgres" user, you can access the PostgreSQL shell by running the following command:
    ```
    psql
    ```
    6. Create a New User and Database (Optional):
    - If you want to create a new user and database, you can use the following commands in the PostgreSQL shell:
    - Create a new user:
    ```
    CREATE USER your_username WITH PASSWORD 'your_password';
    ```
    - Create a new database:
    ```
    CREATE DATABASE your_database_name;
    ```
    - Grant privileges to the user on the database:
    ```
    GRANT ALL PRIVILEGES ON DATABASE your_database_name TO your_username;
    ```
    7. Exit PostgreSQL Shell and Switch Back to Regular User:
    - To exit the PostgreSQL shell, type `\q` and press Enter.
    - Switch back to your regular user account using the following command:
    ```
    exit
    ```
    8. Start Using PostgreSQL:
    - Now you can start using PostgreSQL on your Ubuntu system.
    - You can connect to the PostgreSQL database using a variety of tools such as pgAdmin or by using PostgreSQL-specific libraries in your programming language of choice.
    By following these steps, you can install PostgreSQL on Ubuntu 22.04 LTS and start utilizing its powerful features for your database needs. PostgreSQL is a reliable and robust open-source relational database management system that is widely used in both small and large-scale applications. Enjoy the benefits of PostgreSQL on your Ubuntu system!
    First, we'll explain what PostgreSQL is and why it's a popular choice for relational database management. Then, we'll show you how to download the PostgreSQL installer for Ubuntu from the official website.
    Once you've downloaded the installer, we'll walk you through the installation process, including selecting the installation directory, creating a data directory, choosing a port number, and setting up authentication.
    We'll also show you how to create a PostgreSQL user account and how to start and manage PostgreSQL using the Windows Services panel or the command line.
    By the end of this tutorial, you'll have PostgreSQL installed on your Ubuntu machine and be ready to start using it for your database needs.
    So if you're ready to get started with PostgreSQL on Ubuntu , watch this tutorial now!
    The PostgreSQL installers created by EnterpriseDB are designed to make it quick and simple to install PostgreSQL on your computer. The installer provides:
     a distribution-independent PostgreSQL installation.
     the popular open-source PostgreSQL administration tool, pgAdmin.
     the StackBuilder package manager (used to download and install drivers, tools
    and applications to complement your PostgreSQL installation).
    The sections that follow provide information about using the PostgreSQL 9.6/ PostgreSQL 10 installer:
     How to satisfy hardware requirements and software prerequisites before installing
    PostgreSQL.
     Step-by-step instructions explaining the installation options available with the
    setup wizard.
     How to use Stack Builder to install modules that provide enhanced functionality
    for PostgreSQL 9.6/ PostgreSQL 15.

Komentáře • 100

  • @sherryab3964
    @sherryab3964 Před 7 měsíci +8

    If you are looking to install PostgreSQL on Ubuntu 22.04 then look no further! This is THE video for you! Excellent video. Subscribed!

  • @dorikatz6540
    @dorikatz6540 Před 10 měsíci +1

    Very nice video, simple and fast installtion with many amazing explantion, sub earned.

  • @enockomondi6588
    @enockomondi6588 Před 8 měsíci +2

    Thank you for this resourceful video. Came at the right time.

  • @ZoneTasker
    @ZoneTasker Před měsícem

    Great video which gets straight to the point. Solved issues of connecting from pgAdmin to postgresSQL. I installed on fedora but still found it very helpful! Great stuff!!!

  • @gauravkumar-bs3pf
    @gauravkumar-bs3pf Před 5 měsíci +4

    Thank you man for this easy and straightforward video.

  • @miguelvelascodev
    @miguelvelascodev Před rokem +1

    Amazing, this is so helpful for me, thank you very very much !

  • @YogeshSatishAjilamogaru
    @YogeshSatishAjilamogaru Před 10 měsíci +2

    simple video, easy installation. thank you

  • @clecioluenio3528
    @clecioluenio3528 Před 8 měsíci +1

    Parabéns! Excelente vídeo.

  • @user-ql7od5gh7w
    @user-ql7od5gh7w Před 11 měsíci

    I've been trying to install Postgres on Ubuntu for several days. All the tutorial ended is some error. This was the first video that produced the desired result on the first try.

  • @tonikroos6895
    @tonikroos6895 Před 4 měsíci +1

    you're a saviour man, thanks for this tutorial!!!🙌🙌🙌

  • @ibsengiovanni6656
    @ibsengiovanni6656 Před rokem

    Thank You for this wonderful share.

  • @repairstudio4940
    @repairstudio4940 Před rokem +1

    Great video! ❤

  • @byronk5
    @byronk5 Před 10 měsíci +1

    Fantatsic tutorial! Many thanks!

  • @enechukwuchibuike7234
    @enechukwuchibuike7234 Před 11 měsíci +2

    Amazing video, thank you.

  • @davidbakalarz7103
    @davidbakalarz7103 Před 11 měsíci

    Nice video. I've been stuck on the password error for 4 hours now... Thanks a lot.

  • @avinashdubey6503
    @avinashdubey6503 Před rokem +6

    every youtube video i watch and it worked perfectly in the video. When i tried to do the same thing i always get errors and no solution. Getting tired with linux now.

    • @stephenlipton525
      @stephenlipton525 Před 4 měsíci

      I’m new to Postgres and this worked perfectly for me. You are doing something wrong.

  • @vasimshaikh4874
    @vasimshaikh4874 Před 6 měsíci

    Thanks for helping us to add both desktop/web pgadmin.👏

  • @its_niraj01
    @its_niraj01 Před rokem

    it shows me warning apt-key depreciated;
    After that the terminal stucks. But in ur case it shows ok after the warning.
    Please help me

  • @mh5854
    @mh5854 Před rokem +1

    thanks for everything, you helped me a lot,

  • @ivangordiychuk5510
    @ivangordiychuk5510 Před rokem

    Thanks!!!! This video helped me a lot

  • @veragame4397
    @veragame4397 Před 10 měsíci

    Thanks a lot for your video!!

  • @FunnyKode
    @FunnyKode Před 5 měsíci

    Thanks a lot for the video!
    But I need to know why installing separately desktop and web mode if there is already a command for both ?

  • @restonspositifs3336
    @restonspositifs3336 Před 3 měsíci

    Waouh !! Best tutorial of PostgreSQL installing

  • @jervx829
    @jervx829 Před 3 měsíci

    Is there a way to acccess it using the current user? or it require us to use the user posgres before we can access it?

  • @techcoderuz
    @techcoderuz Před 8 měsíci +1

    Great vidoe, thank you

  • @OnePush-TV
    @OnePush-TV Před 8 měsíci

    Hey @ProgrammingKnowledge is there a way to install pgAdmin4 alongside PostgreSQL?

  • @jdaviddiehl
    @jdaviddiehl Před 9 měsíci

    Nicely done.

  • @NOURELISLAMMOKRANI-pr4ky
    @NOURELISLAMMOKRANI-pr4ky Před 5 měsíci +2

    if u installed on both web and desktop .. no need to run the next 2 lines

  • @gladysgodwin6345
    @gladysgodwin6345 Před měsícem

    When I try the link provided to access the Web version. It doesn't work. Is there a way to access it? I'm using aws ec2 instance

  • @arturgomes1654
    @arturgomes1654 Před 8 měsíci

    great video, thank u so much!

  • @nikhileshjha25
    @nikhileshjha25 Před 4 měsíci

    I am getting this error . please guide me how to rectify this :
    psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
    Is the server running locally and accepting connections on that socket?

  • @rosskleinmann2626
    @rosskleinmann2626 Před 22 dny

    Thank you, this video helped me so much.

  • @ibtehaj95
    @ibtehaj95 Před 8 měsíci

    This was a total lifesaver

  • @stephenlipton525
    @stephenlipton525 Před 4 měsíci

    Great video. Thanks 🙏

  • @devanand9892
    @devanand9892 Před 11 měsíci

    very helpfull , thanks

  • @its_joel7324
    @its_joel7324 Před 10 měsíci

    thank you so much for the video

  • @vasimshaikh4874
    @vasimshaikh4874 Před 6 měsíci

    I have one query why we are not seeing postgresq12 in pgadmin

  • @orazovdidar
    @orazovdidar Před 2 měsíci

    Great tutorial, apreciate it

  • @grant4458
    @grant4458 Před 6 měsíci

    Excellent video thank you so much!

  • @bogdanmilivojevic9619
    @bogdanmilivojevic9619 Před 11 měsíci

    Great video, simple and short, thank you

  • @joseandre8428
    @joseandre8428 Před 10 měsíci

    Thank you so much!

  • @TaxShopGroup
    @TaxShopGroup Před 5 měsíci

    Thank you for this essential help.

  • @Asadbek-hv4tb
    @Asadbek-hv4tb Před 5 měsíci

    very good it works good luck bro

  • @Pradeepalluri-hh6uz
    @Pradeepalluri-hh6uz Před 4 měsíci

    Thank you very much for this video

  • @user-vx2kr3wm6q
    @user-vx2kr3wm6q Před 3 měsíci

    Thank you so much, bro!!

  • @aashutoshupadhyay7888
    @aashutoshupadhyay7888 Před 4 měsíci

    not one of the best but the only best video.

  • @DarioCruz-ee8lc
    @DarioCruz-ee8lc Před 5 měsíci

    Great explanation and great video thanks a lot sir.

  • @user-wp6zl6re3h
    @user-wp6zl6re3h Před 7 měsíci

    simple and amazing video❤

  • @vikas9890
    @vikas9890 Před 4 měsíci

    Excellent video. Thanks a lot Sir

  • @nataliaavila396
    @nataliaavila396 Před 2 měsíci

    Thanks for help!!

  • @yanikoliveira4742
    @yanikoliveira4742 Před 8 měsíci

    Fantastic, thankz

  • @adnanrasheed5494
    @adnanrasheed5494 Před 3 měsíci

    System has not been booted with systemd as init system (PID 1). Can't operate.
    Failed to connect to bus: Host is down
    Error restarting apache2. Please check the systemd logs
    Sir I've face this error .While running this Command (sudo /usr/pgadmin4/bin/setup-web.sh) I've tried too many solutions but not any one resolve my problem. Sir Please help me to overcome this problem. Thank You.

  • @user-cj4en3mt9l
    @user-cj4en3mt9l Před 7 měsíci

    Thank you very much!!!!!!!!!!!!🙂

  • @meqdaddev4341
    @meqdaddev4341 Před 9 měsíci

    Very informative and direct to the point.
    Thanks

  • @sheuahmad9947
    @sheuahmad9947 Před 7 měsíci

    Thank you my good sir

  • @rowansharaf8997
    @rowansharaf8997 Před rokem

    Thank you!

  • @gopimorla1829
    @gopimorla1829 Před 6 měsíci

    Hey such great video thanks buddy

  • @user-jm6hs3ms7q
    @user-jm6hs3ms7q Před 5 měsíci

    Thank for helping!

  • @PickMe_Gaming
    @PickMe_Gaming Před 11 měsíci

    the pgadmin3 are no longer compatible for ubuntu and debian

  • @cybersecuritydivisionmanga955

    Really charming!

  • @faizulla5838
    @faizulla5838 Před 10 měsíci

    Nice

  • @TechFinFacts
    @TechFinFacts Před rokem +1

    Hello, thanks for the video but I have issue, psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: I could not find any clear answer from youtube and stackoverflow, could you make a vidoe please how to fix this issue ? changing peer to md5 is also not working

    • @Fed0usi4
      @Fed0usi4 Před 4 měsíci

      hello. i know its been a while since you wrote this comment. but did you manage to fix this problem? i have the same one and dont know what to do

  • @KamranAli-yj9de
    @KamranAli-yj9de Před 9 měsíci

    Thankyou sir!!!!

  • @IskandarDiyorov-ki7yz
    @IskandarDiyorov-ki7yz Před měsícem

    thank you very much bro

  • @user-ju9cx2mo5l
    @user-ju9cx2mo5l Před 10 měsíci

    Great !

  • @user-fe4fv4gq3d
    @user-fe4fv4gq3d Před rokem

    thank you very much

  • @osegocodes
    @osegocodes Před 2 měsíci

    Great video

  • @janing06
    @janing06 Před 8 měsíci

    Does it work on Linux Mint?

  • @souviknandi9298
    @souviknandi9298 Před rokem

    Thanks.

  • @victortoulouse
    @victortoulouse Před 6 měsíci

    helpfull thank you

  • @stephenlipton525
    @stephenlipton525 Před 4 měsíci

    Have subscribed.

  • @user-ml8qz9gj1j
    @user-ml8qz9gj1j Před 10 měsíci

    thank you

  • @pasan6209
    @pasan6209 Před 6 měsíci

    Thank you

  • @abdoubenkacem6893
    @abdoubenkacem6893 Před 7 měsíci

    amizing

  • @dhaval.doubledotts
    @dhaval.doubledotts Před 5 měsíci

    thanks bro

  • @keakash7906
    @keakash7906 Před 9 měsíci

    Thankyou

  • @bona711
    @bona711 Před 6 měsíci

    tnx_bro

  • @lararawf6100
    @lararawf6100 Před 5 měsíci

    Thanks

  • @XYz-cp9he
    @XYz-cp9he Před 9 měsíci

    thanku uuh

  • @unknownboi9193
    @unknownboi9193 Před 9 měsíci

    thanks

  • @jamjam3337
    @jamjam3337 Před 7 měsíci

    tnx

  • @andersonmoreyra
    @andersonmoreyra Před rokem

    Thatś very coll

  • @user-tb1rc4wv1y
    @user-tb1rc4wv1y Před 5 měsíci

    briliant

  • @adaf22karina
    @adaf22karina Před 2 měsíci

    vielen dank!

  • @Codeing-di3yf
    @Codeing-di3yf Před 3 měsíci

    💗♥

  • @user-qu4sn7eg2w
    @user-qu4sn7eg2w Před 4 měsíci

    Спасибо тебе огромное, единственное видео, которое помогло

  • @user-if6zl8uq5e
    @user-if6zl8uq5e Před 8 měsíci

    Oh man thank you for this. From last 3 days i was wondering what the fuck is password. I didn't entered any password!

  • @MudassirKhan-sx9jy
    @MudassirKhan-sx9jy Před 11 měsíci

    I get the error site can't be reached when opening in chrome

  • @arthur.v.babayan
    @arthur.v.babayan Před 3 měsíci

    curl is a tool that lets you make SECURE downloads and not only downloads !!!

  • @Putu_pererenan
    @Putu_pererenan Před 17 dny

    кюль

  • @ZillaChannel
    @ZillaChannel Před 9 měsíci

    thank a lot friend

  • @imfaizanarif
    @imfaizanarif Před 3 měsíci

    Thank you so much you saving my alot of time🤍

  • @jailtonjjjfilho8423
    @jailtonjjjfilho8423 Před 4 měsíci

    Thank you so much!

  • @joaofelipebarrosneto8719
    @joaofelipebarrosneto8719 Před 6 měsíci

    Amazing video, thanks.

  • @gauragopalj3629
    @gauragopalj3629 Před 3 měsíci

    thank you very much

  • @NagaVishnu-iv6pw
    @NagaVishnu-iv6pw Před 2 měsíci

    thanks

  • @kaosang6754
    @kaosang6754 Před 5 měsíci

    thank you

  • @shrikantdhayje669
    @shrikantdhayje669 Před měsícem

    thanks