Setup website service in Portainer

Self hosted PayloadCMS and PostgreSQL website on Docker

2 min read

Published Jun 17 2025, updated Jun 19 2025


10
0
0
0

CaddyDockerGitHub ActionsJavascriptNextJSPayloadCMSPortainerTailscaleUbuntuUFW

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:

mywebsitedomain.com {
        reverse_proxy localhost:3000
}

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:

sudo systemctl reload caddy

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.


Products from our shop

Docker Cheat Sheet - Print at Home Designs

Docker Cheat Sheet - Print at Home Designs

Docker Cheat Sheet Mouse Mat

Docker Cheat Sheet Mouse Mat

Docker Cheat Sheet Travel Mug

Docker Cheat Sheet Travel Mug

Docker Cheat Sheet Mug

Docker Cheat Sheet Mug

Vim Cheat Sheet - Print at Home Designs

Vim Cheat Sheet - Print at Home Designs

Vim Cheat Sheet Mouse Mat

Vim Cheat Sheet Mouse Mat

Vim Cheat Sheet Travel Mug

Vim Cheat Sheet Travel Mug

Vim Cheat Sheet Mug

Vim Cheat Sheet Mug

SimpleSteps.guide branded Travel Mug

SimpleSteps.guide branded Travel Mug

Developer Excuse Javascript - Travel Mug

Developer Excuse Javascript - Travel Mug

Developer Excuse Javascript Embroidered T-Shirt - Dark

Developer Excuse Javascript Embroidered T-Shirt - Dark

Developer Excuse Javascript Embroidered T-Shirt - Light

Developer Excuse Javascript Embroidered T-Shirt - Light

Developer Excuse Javascript Mug - White

Developer Excuse Javascript Mug - White

Developer Excuse Javascript Mug - Black

Developer Excuse Javascript Mug - Black

SimpleSteps.guide branded stainless steel water bottle

SimpleSteps.guide branded stainless steel water bottle

Developer Excuse Javascript Hoodie - Light

Developer Excuse Javascript Hoodie - Light

Developer Excuse Javascript Hoodie - Dark

Developer Excuse Javascript Hoodie - Dark

© 2025 SimpleSteps.guide
AboutFAQPoliciesContact