This project serves the purpose of setting up a Keycloak
instance leveraging docker compose
exposed over HTTPS leveraging self-signed certificates.
- Docker CE installed (including compose plugin) - How to install Docker CE
- yq YAML processor installed.
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod a+x /usr/local/bin/yq
To get started with this project, you need to run the start.sh
script. This script accepts several options:
--db_user
: PostgreSQL database user. Default: keycloak--db_password
: PostgreSQL database password. Default: keycloak--db_name
: PostgreSQL database name. Default: keycloak--gen_certs
: Indicates if self-signed certificates should be generated--key
: Path to the private key file (required if --gen_certs is not set)--cert
: Path to the certificate file (required if --gen_certs is not set)--cert-cn
: Common Name (CN) for the generated self-signed certificates. Default: Ip of eth0 interface of your system--cert-org
: Organization (O) for the generated self-signed certificates. Default: CodeTriarii--user
: User for the Keycloak instance admin. Default: admin--password
: Password for the Keycloak instance admin. Default: admin--port
: Port for the Keycloak instance. Default: 8443--ream
: [Optional] Points to a realm json file to set the import.--clean
: If set, removes the docker compose and auxiliary generated assets.--debug
: Enables debug verbosity.
Here's an example of how to run the script:
./start.sh --port 8443 --gen_certs
Tip
If you want to enable more verbosity in logs, just pass the --debug
argument!
Tip
If you want the port to be mapped with 443 (privileged port), launch the command with sudo!
Tip
You can load a realm of your own by using the --realm <path-to-file>.json
option.
- Automated start script.
- Included automated clean-up.
- Extended help for user friendly understanding.
- Included multiple args for flexibility.
- Prepared for HTTPS. Either with cert automated generation or inputting your own certs.
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated 💹.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
-
Fork the Project
-
Create your Feature Branch
git checkout -b feature/AmazingFeature
-
Commit your Changes
git commit -m 'Add some AmazingFeature
-
Push to the Branch
git push origin feature/AmazingFeature
-
Open a Pull Request
Distributed under the APACHE 2.0
License.
As we always state, our main purpose is keep learning, contributing to the community and finding ways to collaborate in interesting initiatives.
Do not hesitate to contact us at [email protected]
If you are interested in our content creation, also check our social media accounts. We have all sorts of training resources, blogs, hackathons, write-ups and more! Do not skip it, you will like it 😏 😏 😏 👍
Don't forget to give the project a star if you liked it! Thanks again! 🌟 💛
💯 💯 💯 For those that are curious about some of the resources or utilities and for sure thanking and giving credit to authors, we provide you a list of the most interesting ones (in our understanding) 💯 💯 💯
- eabykov Keycloak Compose - Thank you for the reference. The star is given 😉
- Keycloak in a container - Official Documentation