DEV Community

John  Ajera
John Ajera

Posted on

How to Create an Activation Key for Red Hat Developer Subscription

When using Red Hat Enterprise Linux (RHEL) on cloud or virtual machines, such as EC2 instances, you need to register the system with Red Hat to access software repositories. This registration can be done in two ways:

  • Using your Red Hat username and password
  • Using an activation key tied to your Red Hat Developer subscription

For automation, CI/CD, or cloud-init provisioning, using an activation key is the recommended and secure method.

This guide walks you through how to generate an activation key and register your RHEL system using the Red Hat Hybrid Cloud Console.


๐Ÿงฐ Prerequisites


๐Ÿ” Step 1: Retrieve Your Org ID and Account Number

  1. Go to https://console.redhat.com/
  2. Click your profile icon in the top-right corner
  3. In the dropdown menu, locate your Account number and Org ID
  4. Note down the Org ID โ€” this will be used in the registration command

๐Ÿ” Step 2: Create an Activation Key

To access the activation key section:

  1. At https://console.redhat.com/, use the top search bar and type subscriptions
  2. Click Subscriptions Inventory
  3. Under Getting started resources, click Activate a subscription
  4. Click Create Activation Key and follow the wizard:
  • Name and Description: Enter a unique name (e.g., rhel-subscription)
  • Workload: Choose Latest release (or Extended support releases for LTS needs)
  • System Purpose: Set Usage to Development/Test. Leave Role and SLA as Not defined
  • Review and click Create

๐Ÿ“ฆ Step 3: Add Additional Repositories (Optional)

By default, core repositories like BaseOS and AppStream are enabled. However, you can add more via:

  1. From the Activation Key list, click your activation key name
  2. Scroll to Additional repositories and click Add repositories
  3. Use the search bar to locate and select repositories based on your requirements
  4. Click Save Changes

๐Ÿ’ป Step 4: Register Your RHEL System

Use the following command on your RHEL 8 or RHEL 9 instance:

sudo subscription-manager register \
  --org="<your-org-id>" \
  --activationkey="rhel-subscription"
Enter fullscreen mode Exit fullscreen mode

Example:

sudo subscription-manager register \
  --org="12345678" \
  --activationkey="rhel-subscription"
Enter fullscreen mode Exit fullscreen mode

To enable a repository manually (if not selected during activation key setup):

sudo subscription-manager repos --enable="codeready-builder-for-rhel-9-x86_64-rpms"
Enter fullscreen mode Exit fullscreen mode

List all available repositories:

sudo subscription-manager repos --list
Enter fullscreen mode Exit fullscreen mode

โœ… Step 5: Verify Registration

Check if your system is registered and repositories are active:

sudo subscription-manager status
sudo dnf repolist
Enter fullscreen mode Exit fullscreen mode

You should see a valid subscription and enabled repositories.


๐Ÿงฉ Summary

Using the Hybrid Cloud Console and an activation key tied to your Red Hat Developer account provides a clean, automated way to register RHEL systems. This is especially useful in cloud or ephemeral environments where manual activation isn't practical.

Enjoy automating your RHEL setup with ease!

Top comments (0)