Member-only story
Create a Keycloak instance with a default realm and a service account
Establishing a Keycloak instance with a realm and default service account is essential for effectively managing authentication and authorization in modern applications. This comprehensive guide will demonstrate the step-by-step process to create a Keycloak instance, set up a default realm, and configure a default service account.
Prerequisites
Before we begin, ensure you have the following installed on your system:
- Docker or Podman
- Docker Compose or Podman Compose
- Code Repository: keycloak-default-sa
$ git clone https://github.com/akoserwal/keycloak-integrations.git
$ cd keycloak-default-sa/
In Figure 1.0, you can see the file structure of the directory, which includes the following files.
We will start with docker-before.yaml
to demonstrate the steps required to reach the final setup:docker-compose.yaml
with realm export realm-export.json
and service account test-sa.json
Step 1: Deploying Keycloak using Docker Compose
Let's deploy a Keycloak instance using Docker Compose. We'll use the latest official Keycloak Docker image (current version: 25.0.2).