How to Install SuiteCRM 8 on Fedora

While i was still running into problems I talked to a friend of mine who is trained in IT and who advised me to set it up with docker. He thought I probably would have less problems with upgrading while keeping my operating system more secure as Suite CRM related processes will run within an isolated environment.

So eventually I managed to set it all up on Fedora using docker. Along the way, we ran into a few problems too. Especially ERROR ==> Could not connect to the database on *fresh install* · Issue #25390 · bitnami/containers · GitHub was a tough nut to crack, but found a workaround. It would be great, if somebody with more knowledge about docker could create a pull-request to fix the suite crm docker image provided by Bitnami.

Here is my current solution (I have not tried to make my suite CRM instance to be accessible from the internet yet):

# Guides I followed:

   #https://dexor.de/blog/suitecrm-in-docker/
   #https://github.com/bitnami/containers/tree/main/bitnami/suitecrm#readme

# HOW TO INSTALL
-----------------------------
#Start by installing Docker
#https://docs.docker.com/engine/install/fedora/

# Continue by installing suitecrm
#https://github.com/bitnami/containers/tree/main/bitnami/suitecrm#readme

   git clone https://github.com/bitnami/containers.git
   # cd bitnami/APP/VERSION/OPERATING-SYSTEM
   cd ~/USER/Suite-CRM-Docker-Setup/containers/bitnami/suitecrm

# Now, change the docker-compose.yml file to include correct environment variables parameter
   # Keep in mind that the path to volumes in mariaDB and suiteCRM should differ!
   # Docker will check during creation of suitecrm config, if path of volume is empty and errors out, if otherwise

   #Example for how it worked for me:

       volumes:
       # - 'mariadb_data:/bitnami/mariadb'
         - '/PATH/TO/PERSISTENCE:/bitnami/mariadb'

       volumes:
       # - 'suitecrm_data:/bitnami/suitecrm'
         - '/PATH/TO/PERSISTENCE/DIFFERENT/DIFFERENTTWO:/bitnami/suitecrm'

   # If the error still triggers, remove following 3 lines during inital setup
   # to create suitecrm or php config with non-persistence.
   # Afterwards add these 3 lines back and try to run the container again with persistence.

       volumes:
       # - 'suitecrm_data:/bitnami/suitecrm'
         - '/PATH/TO/PERSISTENCE/DIFFERENT/DIFFERENTTWO:/bitnami/suitecrm'


# follow https://sysctl-explorer.net/net/ipv4/ip_unprivileged_port_start/
# Add net.ipv4.ip_unprivileged_port_start=0 to /etc/sysctl.conf (or /etc/sysctl.d) by going to /etc/syscctl.d and open CLI

    sudo nano 99-sysctl.conf
    net.ipv4.ip_unprivileged_port_start=0
    sudo sysctl --system

# Run the docker container
   
   docker-compose up

# Open new second commandline in different folder (while docker-compose up is running in the first command line!)

    docker ps
    #copy the container ID
    docker exec -it PASTETHECONTAINERID /bin/bash


#Create MYSQL database config (only works if logged into docker via docker exec ...)

    mysql -u root -p
    # enter password from .yml file MARIADB_PASSWORD or MARIADB_ROOT_PASSWORD)

#Create database and grant rights

    CREATE DATABASE put-database-name-here;
    USER put-username-here@localhost IDENTIFIED BY 'put-password-here';
    SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, DROP, ALTER, CREATE TEMPORARY, TABLES, LOCK TABLES ON put-database-name-here.* TO 'put-username-here'@'localhost';


# still within mysql; Check which users are existing:

    select User, Host, Password from mysql.user;
    
    exit
    exit

#The container should now show up in "whaler" (https://github.com/whaler/whaler)
# Start the container again via "whaler" or use "docker-compose up" to run the container

   docker-compose up

# enter 127.0.0.1 in your webbrowser (e.g. Firefox)
    
    # Login via your username or alternatively via
      user: user
      password: bitnami

There were three major hurdles:

  1. persistent volumes for mariaDB and suitecrm should DIFFER. suitecrm config is created AFTER mariaDB and apparently checks if PATH/TO/PERSISTENCE is empty, before trying to create the config. If not empty, no config will be created. At least that’s the hypothesis we have for why the php error was triggered.
  2. I was not able to access the standard port, because my docker is configured to not run as root, hence had to give privileges first.
  3. The mysql database was supposed to be created automatically during initial setup, but it was not, so we had to create it manually from scratch.

Greetings,

ThiloteE