Run Postgres at local without Root access

In short

Use binary portable version from: https://www.enterprisedb.com/download-postgresql-binaries

In long

Working on enterprise laptop means you don't have full root access to run apt-get install

What if you just want to try out postgres quickly on your laptop?

What if you just need pgsql client to run sql and don't want to install all server side service to you laptop?

Download pre-compile binary

Pretty simple, just download the binary from https://www.enterprisedb.com/download-postgresql-binaries then unzip it to a folder.

(Ex: for ubuntu, download http://sbp.enterprisedb.com/getfile.jsp?fileid=11632&_ga=2.126738446.2026645727.1560081382-665989131.1559900236)

If all you need is psql client then you're ready to go. Just run


If you want to run postgres server at local?

Create an empty folder (ex: /data)

Init database
./initdb -D /data --auth=password --username=admin --pwprompt 

Run postgres
./bin/postgres -D /data

Connect to Postgres with url
or connect via url

Or Connect with psql
./bin/psql mydb

Download source and build it

In case you're running a specific Debian which does not have pre-built binary. Things are more difficult.

You can download the source code and compile it by yourself.


However, in many case, the compiler asks to install more compiling package which returns root permission.