Setup website service in Portainer
Self hosted PayloadCMS and PostgreSQL website on Docker
2 min read
Published Jun 17 2025, updated Jun 19 2025
Guide Sections
Guide Comments
So now you have your production docker image built, and pushed to your private registry, we can now deploy this website and put it live.
Add private registry to Portainer
In Portainer, go to 'Registries' on the left menu and select '+ Add registry'.
Select 'custom' and give it a meaningful name such as 'my-private-registry'.
Enter your 'registry.mydomainname.com' registry url.
Select authentication and enter the user and password that you setup, and click 'Add registry'.
Add website service to docker
In Portainer, go to 'Services' on the left menu and select '+ Add service'.
Give the service the same name you set in the workflow earlier.
Select your private regitry from the dropdown.
Enter your image name that you set in the workflow earlier with :latest after it. So like my-image-name:latest.
Add a port mapping, with host whatever port you want to publish and container as 3000.
On the network tab, select the same network that the database was on, in my example it was shared_network.
On the env tab, either add 1 by 1 or select advanced and paste in the env file, with production values.
Click create the service. Thats now running in docker, we need to now add a reverse proxy for that to add a domain name.
Add website to Caddy
Add an A record on your domain you want to use, pointing at your public IP address.
Now you need to update the CaddyConfig file located /etc/caddy/Caddyfile
.
Add another entry for the main website domain name in the Caddyfile:
3000 is the published port above in the service in this example, so if you put a different one then change it here too.
Now reload the Caddy Config:
Your website is now live on your domain name. Just need to lock down the access to the server now and make it more secure.