Question

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:

https://github.com/cvaclav/docker-lemp-stack

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

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

tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 651/systemd-resolve tcp 0 0 0.0.0.0:22 0.0.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.

alexdo
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:

https://www.digitalocean.com/community/questions/how-to-host-multiple-docker-containers-on-a-single-droplet-with-nginx-reverse-proxy

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 www.xxx.com is an alias of domain.com A xxx directs to IP NS xxx directs to ns2.digitalocean.com NS xxx directs to ns3.digitalocean.com NS xxx directs to ns1.digitalocean.com

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

Become a contributor for community

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

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.