Answer the question
In order to leave comments, you need to log in
How to deploy a PostgreSQL database on a local machine for development?
An urgent question, I don’t want to install a full-fledged postgres, but it’s very pleasant to work with this subd. I recently learned that you can somehow use it on a local computer without installation, but I found little useful information on the Internet. Is it really possible to do something like this, or is it necessary to install and configure a full-fledged database? I am using Ubuntu Linux axis.
Answer the question
In order to leave comments, you need to log in
Install Docker and docker-compose . Create a docker-compose.yml file with the following content (see below) and run sudo docker-compose up -d in the file's directory.
version: '2'
services:
db:
image: postgres:13
volumes:
- ./db:/var/lib/postgresql/data/pgdata
ports:
- 5428:5432
environment:
- POSTGRES_USER=user
- POSTGRES_DB=mydatabase
- POSTGRES_PASSWORD=12345
- PGDATA=/var/lib/postgresql/data/pgdata
You don't have to be afraid of it. Postgresql comes from packages already minimally configured. It takes a little time to learn how to create a user and base (there are plenty of tutorials on the net), it will be much easier than fiddling with setting up a base in docker.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question