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
- A Red Hat Developer account: https://developers.redhat.com/register
- Access to the Red Hat Hybrid Cloud Console: https://console.redhat.com/
๐ Step 1: Retrieve Your Org ID and Account Number
- Go to https://console.redhat.com/
- Click your profile icon in the top-right corner
- In the dropdown menu, locate your Account number and Org ID
- 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:
- At https://console.redhat.com/, use the top search bar and type
subscriptions
- Click Subscriptions Inventory
- Under Getting started resources, click Activate a subscription
- Click Create Activation Key and follow the wizard:
-
Name and Description: Enter a unique name (e.g.,
rhel-subscription
) -
Workload: Choose
Latest release
(orExtended support releases
for LTS needs) -
System Purpose: Set
Usage
toDevelopment/Test
. LeaveRole
andSLA
asNot 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:
- From the Activation Key list, click your activation key name
- Scroll to Additional repositories and click Add repositories
- Use the search bar to locate and select repositories based on your requirements
- 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"
Example:
sudo subscription-manager register \
--org="12345678" \
--activationkey="rhel-subscription"
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"
List all available repositories:
sudo subscription-manager repos --list
โ Step 5: Verify Registration
Check if your system is registered and repositories are active:
sudo subscription-manager status
sudo dnf repolist
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)