Setting up a mailserver on ubuntu with docker and having direct admin installed on server at the same time

Hi everyone
I want to set up a Mail server using docker according to this guide

How To Host A Mail Server With Docker For Free (Step-by-Step)]1

at the same time i installed direct admin on my server the problem is both direct admin and certbot use same port 80 so when i want to start docker(my mail server) i get this error

failed to bind port 0.0.0.0:80/tcp: Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use

any help guys? Thank you

My domain is : djangowebstore.ir
My server OS is ubuntu 22

I don't see how is your query related to Let's Encrypt or TLS in general. Sounds to me like a general system administration question. You would be better served at Server Fault.

1 Like

The instructions you linked to use the --standalone option of Certbot. That sets up a temporary web server requiring exclusive use of port 80. Perhaps see if DirectAdmin can use a different port. As using an HTTP Challenge has Let's Encrypt sending you an HTTP request with port 80.

You could research using a DNS Challenge instead. This does not use an HTTP request but rather a DNS TXT record. To automate that requires API or access to your authoritative DNS server to add / delete a TXT record so you can prove control of the domain name.

See: Challenge Types - Let's Encrypt

2 Likes

If you want both services to run on the same machine and be accessible on the same port, the best option probably would be to run the mail server on a different port, and add a virtual host with a different domain/subdomain to the web server config, that acts as a reverse proxy to the mail server. Then you won't need TLS for the mailserver at all, everything can be done in the webserver config.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.