THIS REPO HAS BEEN ARCHIVED AND ALL Axsoter ID STUFF HAS MOVED TO https://github.com/Axsoter/Axsoter-ID
You first need to manually install MariaDB and setup the accounts and databases MariaDB downloader and installer:
bash <(curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup) && sudo apt update && sudo apt install mariadb-server
After that is done just do
bash <(curl -s https://raw.githubusercontent.com/Axsoter/keycloak-dockerfiles/main/ubuntu.sh)
You need to setup your DB accounts and other stuff BEFORE you start anything here (or after, it just won't work before you do it).
First, clone the repository containing all the necessary files.
gh repo clone Axsoter/keycloak-dockerfiles
cd keycloak-dockerfiles
-
Enter username and password: Change the
KEYCLOAK_ADMIN
,KEYCLOAK_ADMIN_PASSWORD
,KC_DB_URL_HOST
,KC_DB_URL_DATABASE
,KC_DB_USERNAME
andKC_DB_PASSWORD
fields inside Dockerfile (nano Dockerfile
) to your wanted admin credentials and current database credentials. -
Run the Build Script:
chmod +x build_keycloak.sh ./build_keycloak.sh
-
Copy the Service File:
sudo cp keycloak.service /etc/systemd/system/
-
Reload Systemd:
sudo systemctl daemon-reload
-
Enable and Start the Service:
sudo systemctl enable keycloak.service sudo systemctl start keycloak.service
-
IMPORTANT; Please change the domain otherwise it WON'T WORK.
-
Copy the Nginx Configuration File:
sudo cp sites-available/login.axsoter.com /etc/nginx/sites-available/
-
Enable the Site:
sudo ln -s /etc/nginx/sites-available/login.axsoter.com /etc/nginx/sites-enabled/
-
Test Nginx Configuration:
sudo nginx -t
-
Reload Nginx:
sudo systemctl reload nginx
-
IMPORTANT; Same as Step 4
-
Install Certbot:
sudo apt install certbot python3-certbot-nginx
-
Obtain and Install the Certificate:
sudo certbot --nginx -d login.axsoter.com
-
Follow the Prompts: Certbot will automatically configure Nginx to use the SSL certificate.
-
Renewal: Certbot sets up automatic renewal, but you can test it with:
sudo certbot renew --dry-run
keycloak-dockerfiles
├── Dockerfile
├── build_keycloak.sh
├── keycloak.service
└── sites-available/
└── login.axsoter.com