Setup a Private Docker Registry
Self hosted PayloadCMS and PostgreSQL website on Docker
1 min read
Published Jun 17 2025, updated Jun 19 2025
Guide Sections
Guide Comments
Now we are going to setup a private docker registry where we can store our image. You can always pay for a private account on Docker Hub if you don't want to do this step.
The registry is going to be secured with htpasswd authentication.
On your local computer, with docker installed, run this command:
Replacing myuser and mypassword with whatever you would like to use to login to the registry.
This will create a file called auth.
Go to 'Configs' on the left menu of Portainer.
Click '+ Add Config'
Name it 'htpasswd' and paste the contents of the auth file you generated as the config value.
In Portainer, go to 'Stack' on the left hand menu and then click '+ Add Stack' button at the top right.
Give the stack a name, such as 'registry'.
In the web editor paste:
Click 'Deploy the Stack' button to deploy your registry with the authentication setup, running on port 5000.
In order to access it we need to add a reverse proxy with SSL enabled which we will do in the next section.