Configure Keycloak Email with Zoho Mail on AWS EC2

When running Keycloak on an AWS EC2 instance, like my own deployment at keycloak.maksonlee.com, you’ll likely want to enable features like:

  • Email verification
  • Password reset
  • Admin notifications

In this guide, I’ll walk you through configuring Keycloak to send emails using Zoho Mail via SMTP, based on my earlier post:

How to Set Up Free Email with Zoho Mail and Your Custom Domain Using Cloudflare DNS


Prerequisites

  • Keycloak is accessible at https://keycloak.maksonlee.com
  • You’ve set up Zoho Mail with your custom domain (e.g., admin@maksonlee.com)
  • Your EC2 instance allows outbound traffic on ports 465 and 587
  • You have a Zoho app password for SMTP access (not your main Zoho login)

Configure SMTP in Keycloak Admin Console

  • Open your browser and go to:
    https://keycloak.maksonlee.com
  • Log in as an admin and select the target Realm.
  • Go to Realm settings → Email.
  • Fill in the form as follows:

Template

FieldValue
Fromadmin@maksonlee.com
From display nameMakson Keycloak (optional)
Reply toadmin@maksonlee.com (optional)
Reply to display nameMakson Support (optional)
Envelope fromadmin@maksonlee.com (optional)

Connection & Authentication

FieldValue
Hostsmtp.zoho.com
Port587
Enable SSLDisabled
Enable StartTLSEnabled
AuthenticationEnabled
Usernameadmin@maksonlee.com
Authentication TypePassword
Password<your Zoho app password>
  • Click Test Connection to confirm that SMTP works.

AWS EC2-Specific Notes

  • AWS blocks port 25 by default. Use port 587 with StartTLS for maximum compatibility.
  • Ensure your EC2 Security Group allows outbound traffic to:
    smtp.zoho.com:587
  • You don’t need to open any inbound ports for SMTP.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top