Skip to content

Setting up your PostgreSQL server

Eva Myers edited this page Feb 21, 2025 · 5 revisions

With the release of version 4.0 we no longer ship the database in a container. Instead customers should use their own instance of Postgres to host the database.

Recommended requirements for postgres server without Macromolecule Hub:

  • Postgres version 14 or newer
  • 100GB free hd space

Recommended requirements for postgres server including Macromolecule Hub:

  • Postgres version 14 or newer
  • 200GB free hd space

For supported operating systems the native version of postgres should be sufficient. To install on RHEL / Rocky Linux:

sudo yum install postgresql-server

To install on Ubuntu:

sudo apt-get install postgresql

N.B. The postgresql server must also be configured to allow network connections from the WebCSD server.

Getting the latest version of the CSD Database

Contact support@ccdc.cam.ac.uk for assistance in getting the postgres database / databases you need. They will be able to provide you with a link to download the databases to your infrastructure.

Restore database

Restore the databases you have downloaded into your new environment. If you are replacing an existing database first delete it:

psql -c "DROP DATABASE \"csd-database\""

Then install the new database:

psql -c "CREATE DATABASE \"csd-database\""
pg_restore --no-owner -d csd-database < downloaded_database_name.dump

If you are unable to perform a database backup as described above, please contact support@ccdc.cam.ac.uk for assistance.

Point services to use the postgres databases

The best way to do this is to update the .env file as part of your installation. The connection string is held within the CSD_DB_CONNECTIONSTRING parameter.

CSD_DB_CONNECTIONSTRING=Server=database-server;Port=5432;Database=csd-database;User Id=postgres;Password=passwordhere