Best Cosmetic Hospitals Near You

Compare top cosmetic hospitals, aesthetic clinics & beauty treatments by city.

Trusted • Verified • Best-in-Class Care

Explore Best Hospitals

KEYCLOAK 26.3.3 – COMPLETE GUIDE TO BOOTSTRAP ADMIN (WORKING)

Below is a fully comprehensive, step-by-step, production-ready guide for Keycloak 26.3.3 explaining:

✔ How bootstrap admin works
✔ Why admin-user.json does not exist
✔ How to create a temporary admin
✔ How to convert temporary admin → persistent admin
✔ How to start in dev/prod mode
✔ All correct commands
✔ All common errors + solutions
✔ Directory structure + security notes

This is the most detailed guide you will find for Keycloak 26.x (Quarkus).


✅ 🔥 KEYCLOAK 26.3.3 – COMPLETE GUIDE TO BOOTSTRAP ADMIN (WORKING)

Keycloak 26 uses a new security model for admin creation.

⭐ Key Changes in Keycloak 26

  1. No admin-user.json file
    ✔ Keycloak 25+ does not store admin user in data/admin-user.json anymore
    ✔ It temporarily injects admin user into DB during bootstrap, then removes it
  2. bootstrap-admin user syntax replaced create
  3. --password removed
    ✔ Only --password:env VARIABLE is allowed
  4. Admin account created is Temporary
    ✔ Exists only while server is starting
    ✔ After server exits, admin is gone unless “persisted”

🔥 PART 1 — UNDERSTANDING BOOTSTRAP ADMIN IN KEYCLOAK 26

Keycloak has two kinds of admin:

1️⃣ Temporary Admin (Bootstrap Admin)

  • Created using: kc.sh bootstrap-admin user ...
  • Lives only until Keycloak fully boots
  • After server stops → admin disappears
  • Used only to get first-time access to admin console

2️⃣ Persistent Admin (Stored in DB)

  • Created from Keycloak Admin Console
  • Stored permanently
  • Does NOT depend on bootstrap admin

❗ Keycloak does NOT store bootstrap admin in:

  • MariaDB/MySQL tables
  • admin-user.json
  • Environment variables

Therefore, you cannot see it in DB.


🔥 PART 2 — CREATING TEMPORARY ADMIN (WORKING)

Step 1 — Stop Keycloak

./bin/kc.sh stop

(If already stopped, ignore errors)


Step 2 — Set password via environment variable

export KEYCLOAK_ADMIN_PASSWORD="Admin@123"

✔ REQUIRED for Keycloak 26+
✔ Inline passwords are NOT allowed


Step 3 — Create temporary admin user

./bin/kc.sh bootstrap-admin user --username admin --password:env KEYCLOAK_ADMIN_PASSWORD

Expected output:

KC-SERVICES0077: Created temporary admin user with username admin
Keycloak started...
Keycloak stopped

✔ This confirms temporary admin is created
✔ Keycloak immediately stops after creation (normal behavior)


🔥 PART 3 — START KEYCLOAK

Development Mode (for testing)

./bin/kc.sh start-dev

URL:

http://your-domain:8080

✔ Works immediately
✔ Accepts local-only settings
✔ Auto-generates certificates
❌ Not for production


Production Mode (recommended)

./bin/kc.sh start

If you have SSL reverse proxy:

  • Apache
  • Nginx
  • HAProxy

URL:

https://auth.motoshare.in

🔥 PART 4 — LOGIN USING TEMPORARY ADMIN

Login page:

http://auth.motoshare.in:8080/admin

Use:

  • Username: admin
  • Password: Admin@123

After you log in, you MUST IMMEDIATELY create a permanent admin user.


🔥 PART 5 — CREATE PERMANENT ADMIN (VERY IMPORTANT)

Inside Admin Console:

Go to:

Master Realm → Users → Add User

Fill:

  • Username: admin
  • Email: your email
  • Enabled: ON
  • Email Verified: ON

Save → Credentials tab → Set password

  • Set: Admin@123
  • Temporary: OFF

Correct.

Now this admin is stored in your MariaDB.


🔥 PART 6 — CONFIRM ADMIN IS PERSISTENT IN DB

In MariaDB:

use keycloak;

SELECT USERNAME FROM USER_ENTITY WHERE USERNAME = 'admin';

You should see:

+----------+
| USERNAME |
+----------+
| admin    |
+----------+

✔ Now Keycloak will keep this user forever
✔ No need to use bootstrap-admin again
✔ Safe for production


🔥 PART 7 — WHY admin-user.json DOES NOT EXIST ANYMORE?

Keycloak 24+ removed this file for security reasons.

Temporary admin is not stored in filesystem.

Boot sequence:

  1. Start Keycloak
  2. Inject temporary admin into memory
  3. Start admin console
  4. Temporary admin is removed after server stops

So this is correct:

cat data/admin-user.json
No such file or directory

🔥 PART 8 — COMMON ERRORS + FIXES

❌ Error:

Unknown option: --password

✔ Fix:

Use environment variable:

export KEYCLOAK_ADMIN_PASSWORD="Admin@123"
--password:env KEYCLOAK_ADMIN_PASSWORD

❌ Error:

Missing required subcommand

✔ Fix:

Keycloak 26 requires:

bootstrap-admin user ...

Not:

bootstrap-admin create ...

❌ Admin not saved in DB

✔ You forgot to create Permanent Admin
✔ You used bootstrap-admin only
✔ bootstrap admin is temporary


❌ Cannot login after restart

Because temporary admin is gone.

✔ Create permanent admin.


🔥 PART 9 — FULL COPY–PASTE SCRIPT (PRODUCTION READY)

cd /opt/auth.motoshare.in

./bin/kc.sh stop

export KEYCLOAK_ADMIN_PASSWORD="Admin@123"

./bin/kc.sh bootstrap-admin user --username admin --password:env KEYCLOAK_ADMIN_PASSWORD

./bin/kc.sh start   # or start-dev

Then login → create permanent admin.


🔥 PART 10 — HOW TO PERSIST ADMIN BEFORE FIRST LOGIN (OPTIONAL)

If you want automatic DB admin creation without UI:

INSERT INTO USER_ENTITY (ID, EMAIL, EMAIL_CONSTRAINT, ENABLED, USERNAME, CREATED_TIMESTAMP, REALM_ID, FEDERATION_LINK, SERVICE_ACCOUNT_CLIENT_LINK) 
VALUES ('admin-id-123', 'admin@admin.com', 'admin@admin.com', 1, 'admin', 1735730400000, 'master', NULL, NULL);

INSERT INTO CREDENTIAL (ID, TYPE, USER_ID, REALM_ID, CREATED_DATE, SECRET_DATA, CREDENTIAL_DATA, PRIORITY)
VALUES (
  'cred-id-123', 
  'password', 
  'admin-id-123', 
  'master',
  1735730400000,
  '{"value":"HASHED_PASSWORD"}',
  '{"hashIterations":27500}',
  0
);

(Note: You must generate password hash via Keycloak API → I can provide)


🎯 FINAL SUMMARY

TaskCommand
Create temporary adminbootstrap-admin user --username admin --password:env KEYCLOAK_ADMIN_PASSWORD
Set password envexport KEYCLOAK_ADMIN_PASSWORD="Admin@123"
Start dev modekc.sh start-dev
Start prodkc.sh start
Permanent adminCreate via admin console
Check admin in DBSELECT USERNAME FROM USER_ENTITY

Best Cardiac Hospitals Near You

Discover top heart hospitals, cardiology centers & cardiac care services by city.

Advanced Heart Care • Trusted Hospitals • Expert Teams

View Best Hospitals
<p data-start="140" data-end="435">I’m Abhishek, a DevOps, SRE, DevSecOps, and Cloud expert with a passion for sharing knowledge and real-world experiences. I’ve had the opportunity to work with <a class="decorated-link" href="https://www.cotocus.com/" target="_new" rel="noopener" data-start="300" data-end="335">Cotocus</a> and continue to contribute to multiple platforms where I share insights across different domains:</p> <ul data-start="437" data-end="922"> <li data-start="437" data-end="514"> <p data-start="439" data-end="514"><a class="decorated-link" href="https://www.devopsschool.com/" target="_new" rel="noopener" data-start="439" data-end="485">DevOps School</a> – Tech blogs and tutorials</p> </li> <li data-start="515" data-end="599"> <p data-start="517" data-end="599"><a class="decorated-link" href="https://www.holidaylandmark.com/" target="_new" rel="noopener" data-start="517" data-end="569">Holiday Landmark</a> – Travel stories and guides</p> </li> <li data-start="600" data-end="684"> <p data-start="602" data-end="684"><a class="decorated-link" href="https://www.stocksmantra.in/" target="_new" rel="noopener" data-start="602" data-end="647">Stocks Mantra</a> – Stock market strategies and tips</p> </li> <li data-start="685" data-end="764"> <p data-start="687" data-end="764"><a class="decorated-link" href="https://www.mymedicplus.com/" target="_new" rel="noopener" data-start="687" data-end="732">My Medic Plus</a> – Health and fitness guidance</p> </li> <li data-start="765" data-end="841"> <p data-start="767" data-end="841"><a class="decorated-link" href="https://www.truereviewnow.com/" target="_new" rel="noopener" data-start="767" data-end="814">TrueReviewNow</a> – Honest product reviews</p> </li> <li data-start="842" data-end="922"> <p data-start="844" data-end="922"><a class="decorated-link" href="https://www.wizbrand.com/" target="_new" rel="noopener" data-start="844" data-end="881">Wizbrand</a> – SEO and digital tools for businesses</p> </li> </ul> <p data-start="924" data-end="1021">I’m also exploring the fascinating world of <a class="decorated-link" href="https://www.quantumuting.com/" target="_new" rel="noopener" data-start="968" data-end="1018">Quantum Computing</a>.</p>

Related Posts

Chasing Waterfalls & Golden Sands: The Ultimate Goa Vacation Guide

Welcome to the ultimate Goa Travel Guide! Whether you are planning an adrenaline-fueled solo adventure, a romantic honeymoon, or a memorable family trip, this sun-kissed coastal paradise…

Read More

Global Guide to Plastic Surgery: Top Destinations, Costs, and Safety

The demand for aesthetic surgery has evolved into a global movement. Today, millions of patients travel across borders for medical tourism, seeking a balance of world-class medical…

Read More

Best Places to Visit in India: The Ultimate India Travel Guide

An absolute kaleidoscope of landscapes, cultures, and traditions, India is a destination that alters every traveler who steps foot on its soil. From the snow-capped peaks of…

Read More

DevOps Tutorial for Beginners: Roadmap to Success

The software development landscape is shifting faster than ever. simply knowing how to write code or configure a cloud server is no longer enough. Organizations require seamless…

Read More

DevOps Consulting for Legacy System Modernization a Practical Roadmap

Introduction Many global enterprises continue to rely on legacy infrastructure and monolithic codebases because they handle high-volume, mission-critical transactions that keep business running. However, maintaining these aging…

Read More

Medical Tourism in India: Treatment Costs, Hospitals, and Patient Planning Guide

Introduction Medical tourism in India has become a trusted choice for many patients who want quality healthcare, experienced doctors, advanced hospitals, and affordable treatment options. International and…

Read More
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x