This post focuses on how to install PostgresML on Rocky Linux 9. We will discuss one method to install PostgresML using its source code and Docker. Take a look!
Installing PostgresML on Rocky Linux 9
A simplified way of testing the power of PostgresML in creating AI applications that harness the capacity of machine learning models is by creating a free account on the PostgresML website. They give 5 GB space for users to test PostgresML. Once you are satisfied with it, you can install it on your device by compiling its source code.
With PostgresML, you can comfortably utilize SQL to train and perform the inferences on tabular or text data to meet your goal. To compile its available source code on its GitHub code, you should have the PostgreSQL installed alongside Docker that you will use to build the AI application database.
1. Install PostgreSQL
Before you install PostgreSQL, start by updating the apt repository of your Rocky Linux 9.
Rocky Linux 9 comes with installed PostgreSQL 13, but we install PostgreSQL 14 for this case. Start by adding the PostgreSQL 14 repository by executing the following command:
Aftre adding the PostgreSQL 14 repository, you should disable the default version that comes pre-installed using the following command:
You can now install PostgreSQL 14 using the following command. Press “y” when prompted for Rocky Linux 9 to install the dependency tree:
Initialize the installed PostgreSQL server as follows:
Lastly, start the PostgreSQL server.
Confirm its status to ensure that it is running.
2. Install Docker
Installing the latest Docker version on the Rocky Linux 9 is the ideal way when you want to build the PostgresML AI applications. Update the system package database using the following command:
Add the repository for the Docker package with the following command. You need the repository to access the latest Docker version. Run the following command to add the repository:
You can then install Docker and the prerequisite packages with the following command. Ensure that you confirm the installation by pressing “y” when prompted:
Once the installation is completed, you can start the Docker as follows:
Check the Docker status to ensure that it is active to guarantee that we can build the PostgresML application on the next step.
3. Install PostgresML via the Source Code
PostgresML is open-source, and you can clone its repository using “git”. If you don’t have “git” installed, quickly install it with the following command:
You can access the PostgresML code from its GitHub page. According to its installation guide, start cloning the PostgresML repository using “git”.
Once the repository completes cloning, ensure that the dockerized services are running. Then, use the “cd” command to access the “postgresml” folder.
If you check the contents of the “postgresml” folder, it contains all the necessary files that are required to complete building the PostgresML on your Rocky Linux 9. To build PostgresML, you need the extension and its dashboard app. However, you can use the Docker compose “up” command to utilize the Docker files in the cloned repository to install and build PostgresML.
All the required files are downloaded to facilitate the build. Once it is completed, you now have PostgresML installed on your Rocky Linux 9.
You can now connect to Postgres to work with the PostgresML using “psql” or any other SQL IDE. Use the following command to connect to Postgres and start utilizing it:
We are using port 5433 since it is the port that PostgresML utilizes to run on the local host.
Conclusion
Installing PostgresML on Rocky Linux 9 involves a couple of steps. This post detailed the route to install PostgresML locally on your system. If you only need to test it, access its website and sign up to get a free account to train and test your machine learning models. That’s it!