Running with podman

Run using podman but you can replace docker and it will work the same.

From: https://github.com/postgis/docker-postgis Run a basic container (rootless):

podman run --name some-postgis -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgis/postgis

If you want to mount volume:

podman run -v ~/workspace/data:/mnt/data --name some-postgis -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis 

If you want to copy a file to the container:

podman cp path/to/file.geojson some-postgis:/tmp/

Check that its running and everything is good:

podman ps
podman logs some-postgis

Connect to it:

podman exec -ti some-postgis psql -U postgres

Create a database:

CREATE DATABASE my_new_database;
\q

After creating the database you may want to Restore PostGIS Database from Backup or Import GeoJSON Into Database