# Running `postgres` in a container ## Docker ``` ``` ## Singularity ``` mkdir -p $HOME/code/postgres/data mkdir -p $HOME/code/postgres/run cd -p $HOME/code/postgres/ singularity build postgres.sif docker://postgres:14.0 ``` You will need to setup a password before you proceed ``` export POSTGRES_PASSWORD=password ``` and then start the server ``` singularity run -B data:/var/lib/postgresql/data -B run:/var/run/postgresql postgres.sif ```