4.4.3 Installation

Two external tools must be installed:

  1. PostgreSQL
  2. Golang-Migrate

Debian provided installation packages (.deb) for PostgreSQL.

example output

satnms@satnms7-dev:~$ su -
Password:
root@satnms7-dev:~# apt-get update
Hit:1 http://security.debian.org/debian-security bookworm-security InRelease
Hit:2 http://deb.debian.org/debian bookworm InRelease
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease
Reading package lists... Done

root@satnms7-dev:~# apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@satnms7-dev:~# apt-get install postgresql
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  ... postgresql-client-15 postgresql-client-common postgresql-common ...
The following NEW packages will be installed:
  ... postgresql-client-15 postgresql-client-common postgresql-common ...
0 upgraded, 17 newly installed, 0 to remove and 0 not upgraded.
Need to get 49.1 MB/49.1 MB of archives.
After this operation, 200 MB of additional disk space will be used.
Do you want to continue? [Y/n]
... downloading and installing packages ...

By default Linux user postgres has access to the database from localhost only without password.

To test if the PostgreSQL database was installed and started successfully, you can connect with command line tool psql (in short CLI):

example output

root@satnms7-dev:~# su - postgres
postgres@satnms7-dev:~$ psql
psql (15.10 (Debian 15.10-0+deb12u1))
Type "help" for help.

postgres=# \q
postgres@satnms7-dev:~$

To install Golang-migrate you need to manually download the Debian AMD64 package

example output

root@satnms7-dev:~# apt-get install /home/public/migrate.linux-amd64.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'migrate' instead of '/home/public/migrate.linux-amd64.deb'
The following NEW packages will be installed:
  migrate
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/16.2 MB of archives.
After this operation, 53.2 MB of additional disk space will be used.
Get:1 /home/public/migrate.linux-amd64.deb migrate amd64 4.18.1 [16.2 MB]
Selecting previously unselected package migrate.
(Reading database ... 55809 files and directories currently installed.)
Preparing to unpack .../public/migrate.linux-amd64.deb ...
Unpacking migrate (4.18.1) ...
Setting up migrate (4.18.1) ...

You can test the successfull installation with migrate --version which should display the installed version number, e.g. 4.18.1