TrademarkTrademark
Features
Documentation

Scalr offers a free private module registry

Learn how to use the private module registry
Ryan FeeOctober 30, 2023
Scalr offers a free private module registry
Key takeaways
  • Scalr includes a private module registry on its free plan, and using it is not required to execute runs through Scalr.
  • A private module registry provides security and compliance guardrails, reusable code across projects, and access control the public registry lacks.
  • Modules are pulled from a VCS repository and can be published at the account scope, where all environments inherit them, or at the environment scope for that environment only.
  • To use a registry module outside Scalr or in local execution, authenticate with terraform login <account>.scalr.io, then add the module code and run terraform init.
  • HCP Terraform discontinued its free tier on March 31, 2026, and Scalr positions its free registry as an alternative to Terraform Enterprise and HCP Terraform.

Terraform modules let you package a set of resources and configuration into something reusable, which makes infrastructure easier to manage and cuts down on copy-pasted code. You usually store modules in a version control system like GitHub, since git tags give you version constraints to pin against. Most Terraform users meet the public Terraform registry first, and it's the common starting point for sourcing modules.

A private module registry is the alternative when the public one doesn't give you enough control over your Terraform and OpenTofu code. It matters most in enterprise settings, where several teams work on the same critical infrastructure and need modules kept private. Plenty of tools charge for a private registry, but Scalr includes the use of it on the free plan and it is not required to execute the runs through Scalr. For example, Terraform Cloud's free registry never included team management, module sharing across organizations, or the ability to deploy private modules into a workspace through no-code provisioning. HCP Terraform discontinued its free tier entirely on March 31, 2026. Scalr includes all of that on the free plan.

Main Benefits of a Module Registry

There are many benefits to using a module registry, but here are a few of the primary benefits that our customers get using the registry:

Security & Compliance: A private module registry allows you to enforce standards instead of having your Terraform users use public modules. The public registry does not have any guardrails or verification of code before Terraform modules are posted.

Reusable code: Creating and maintaining reusable modules is one of the key principles of Terraform. A private module registry allows for the distribution of Terraform modules across projects within a small or large organization. This promotes consistency through module sharing and reduces duplication of the Terraform configurations.

Access Control: A private module registry allows you to control who can access and modify modules. This is crucial in larger organizations where multiple teams or individuals are working on the code. You can restrict access to specific modules to only authorized Terraform users or teams, ensuring that your infrastructure remains secure and compliant.

Setting up the Registry

The Scalr module registry works by pulling in the modules from a VCS repository. The first step is to make the connection with your VCS repo of choice. Next, if you haven't done so, create a module in your VCS provider and ensure it follows the standard Terraform or OpenTofu naming conventions of terraform-<provider_name>-<module_name>, e.g. terraform-aws-s3-bucket. If you need an example to start with, try forking this S3 module.

Import the module into Scalr once you have connected the VCS provider and created a module in a repo. A module can be created in the Scalr module registry in two places, the account or environment scope. Read more about the Scalr scopes here.

If a module is created at the account scope, all Scalr environments will automatically inherit it and all teams will be able to consume it. If a module is created at the environment scope, only that environment and its teams can use it.

To publish private modules, go to the module registry, select publish module, and then select the VCS provider and the repo that contains the module:

Publishing a module in Scalr by selecting the VCS provider and repository

If you have multiple modules in the same repo you can define the path to the root.

Using the Registry

Using the modules in the registry comes down to one thing: being authenticated to Scalr. If you're using the module in a Scalr workspace that has Scalr set as the remote backend, that authentication is handled for you.

If you're using the module outside of Scalr or in a run that is using local execution, you'll need to make sure your user is authenticated to Scalr. To authenticate, you can run the following:

terraform login <account>.scalr.io

This will create and store the credentials in a credentials.tfrc.json locally.

Next, you'll want to grab the module code from Scalr. Go to the registry in Scalr, click on the module that was published, and copy the code:

screenshot of the code to create a module registry

Add the code to your Terraform configuration files and then run a terraform init:

terraform init
 
Initializing the backend...
Initializing modules...
Downloading scalr-demo.scalr.io/acc-sscctbisjkl35b8/s3-bucket/aws 5.0.0 for s3-bucket...
- s3-bucket in .terraform/modules/s3-bucket

As seen above, the module is now being pulled from the Scalr private module registry. You can now proceed to run Terraform plan and apply.

Wrapping Up

The public registry is the heart of the Terraform community. It's where most people start when they write their first Terraform code, and it's good at distributing modules. What it doesn't give you is the control and visibility a large organization needs once that code is deploying real infrastructure.

A private module registry covers that gap. It makes module sharing straightforward and gives you a safer path for getting infrastructure code into production. Scalr's private module registry is completely free to use and is a great alternative to products like Terraform Enterprise or HCP Terraform, whose free tier was limited and has since been discontinued (March 31, 2026). Give it a try today!

About the author
Ryan Feedirector of platform engineering at Scalr
Ryan Fee is the director of platform engineering at Scalr, with over 15 years of experience improving infrastructure experiences at companies large and small.