How to create a user for Postgres from the command line for bash automation March 22, 2023 by Tarik This will create user admin with password test101 on localhost: psql -c "CREATE USER admin WITH PASSWORD 'test101';"