Using Postgresql in non-daemon way

I don't like to install servers on my local and run these as service. This is why i am a big fan of Docker.

But sometimes i just want to use servers as an ordinary apps. Without install system-wide.

You know that, as instance; when you install postgresql, its creating a user, installing files to you root directories, changing ownerships and creating service files bla bla.

Today, i wanted to run postgresql as not a service. Its easier than you think.

adduser postgres
su postgres
mkdir ./var/data
./psql/initdb ./var/data -U postgres -W
#write password
./bin/postgres -D var/pgsql/data -k .
./bin/psql -h
#its ok now, let create a db
./bin/createdb hedefim -h
#you can create another super user
./bin/createuser -s hedefim_user -W -h
#write new password

#you can now connect the database with your new user
./bin/psql -U hedefim_user -W hedefim -h

how its easy, right.

talk soon.

#en #postgresql