Atlas Hub uses a Postgres database. The database can be shared and on another server. Here’s a short install guide if you would like to set everything on the same server.
Here is a quick guide to install postgres if you do not already have a database configured.
After setting up the database you should revisit the postgres config and tune it to work best on your server.
apt install -y postgresql postgresql-contrib
apk add postgresql postgresql-contrib
# on new servers the mirror streams may need to be updated.
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
# find latest version
dnf module list postgresql
# install latest version
dnf module enable -y postgresql:13
yum install -y postgresql-server postgresql-contrib
# start and enable it.
systemctl start postgresql
systemctl enable postgresql
# or if you are in docker
apt install -y sudo
/etc/init.d/postgresql start
mkdir /run/postgresql
chown postgres:postgres /run/postgresql/
# next switch over to the postgres non-root user.
# run commands individually and not as a batch.
su postgres -
mkdir /var/lib/postgresql/data
chmod 0700 /var/lib/postgresql/data
initdb -D /var/lib/postgresql/data
pg_ctl start -D /var/lib/postgresql/data
exit
# start and enable and initialize
systemctl start postgresql
systemctl enable postgresql
postgresql-setup --initdb
# or if you are in docker
yum install -y sudo
sudo -u postgres /usr/bin/initdb /var/lib/pgsql/data/ --no-locale --encoding=UTF8
sudo -u postgres /usr/bin/pg_ctl start -D /var/lib/pgsql/data -s -o "-p 5432" -w -t 300
You can check if postgres is running with pg_isready.
# create a web user
su - postgres -c "psql --command \"CREATE USER web_user WITH PASSWORD '1234_with_single_quotes';\""
# give user access to a db
su - postgres -c "createdb -O web_user atlas-hub"