Connection refused using domain name and droplet IP

Hi, i have a droplet with my domain name assoaciated, i don’t add a firewall rule and the UFW is disabled.

I installed an Ubuntu18.04 and i used this repo to set the environment:

Actually when y write the IP of my droplet on Chrome say: ERR_CONNECTION_REFUSED

Result of -> netstat -anltp | grep “LISTEN”

tcp 0 0* LISTEN 651/systemd-resolve tcp 0 0* LISTEN 848/sshd tcp6 0 0 :::22 :::* LISTEN 848/sshd

This is the status of the docker containers:

STATUS PORTS NAMES Up 10 minutes 80/tcp xxx_nginx Up 10 minutes 9000/tcp xxx_php-fpm Up 10 minutes 80/tcp xxx_phpmyadmin Up 10 minutes 3306/tcp xxx_mysql

I am not sure if I have to activate the UFW with some rules or if I have to use the firewall from the networking menu.

Thank’s for your help!

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Site Moderator
Site Moderator badge
April 24, 2020
Accepted Answer

Hello, @webcf931eb5d0d1

I assume that the DNS is pointed correctly (domain name is pointed to the IP address of the droplet and that the DNS has already propagated, this can take up to 48 hours in order to fully update)

Looking at the provided output from the netstat command there is no service listening on port 80 and thus you get the ERRCONNECTIONREFUSED error. Have you installed any web server like Apache or Nginx before going forward with the docker setup?

When you created the container did you binded any port on the host to forward the traffic to the container, e.g the phpMyAdmin one?

You can send me the output of the following command:

docker ps -a

This will list the running containers and we can check if you’ve binded any port on the host with the containers.

Additionally you can check this super helpful question posted in the community and also check the video listed in it:

Hope this helps!

Let me know how it goes.

Regards, Alex

Hi Alex, thank’s for your help.

On the DNS server (external DigitalOcean) i have this line:

A @ Point to: IP

Digital Ocean DNS records:

CNAME is an alias of A xxx directs to IP NS xxx directs to NS xxx directs to NS xxx directs to

The result of docker ps -a

STATUS PORTS NAMES Up 15 hours 80/tcp xxx_nginx Up 15 hours 9000/tcp xxx_php-fpm Up 15 hours 80/tcp xxx_phpmyadmin Exited (1) 15 hours ago xxx_traefik Exited (1) 15 hours ago xxx_portainer Up 15 hours 3306/tcp xxx_mysql

When i enter the server via SSH i say this message:

Welcome to DigitalOcean’s One-Click Docker Droplet. To keep this Droplet secure, the UFW firewall is enabled. All ports are BLOCKED except 22 (SSH), 2375 (Docker) and 2376 (Docker).

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel