Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm having terrible problems with PostgreSQL initialization on my VPS. I followed several tutorials on this topic and nothing made my database server work.

I followed these steps:

sudo apt-get install postgresql postgresql-contrib
su – postgres

Then when I try to name a new role, I get this:

createuser: could not connect to database postgres: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Stuff I tried after that:

/etc/init.d/postgresql status

Shows no output.

Seeing if process is running:

root@Ubuntu-1204-precise-64-minimal ~ # ps auxwww | grep postgres
postgres 19848  0.0  0.2  40812  1348 pts/0    S    16:23   0:00 su - postgres
postgres 19849  0.0  1.3  25524  6804 pts/0    S    16:23   0:00 -su
postgres 20161  0.0  0.2  40812  1344 pts/0    S    16:35   0:00 su - postgres
postgres 20162  0.0  1.3  25524  6800 pts/0    S    16:35   0:00 -su
root     24977  0.0  0.1   9392   900 pts/0    S+   17:44   0:00 grep --color=auto postgres


sudo aptitude purge postgresql postgresql-8.4 postgresql-common
sudo apt-get install postgresql postgresql-contrib

Install messagges show no errors but when I try to open postgres' folder, I get this:

root@Ubuntu-1204-precise-64-minimal ~ # cd /etc/postgresql/
-su: cd: /etc/postgresql/: No such file or directory

Because of the latter I reckon there might be something wrong with the installation?

share|improve this question
What's the result of dpkg --list | grep postgresql? –  Milen A. Radev Feb 15 '14 at 19:12
I managed to get it working using this answer: stackoverflow.com/a/2748644/1371048 –  Matic Jurglič Feb 16 '14 at 12:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.