By dwm
I’m trying to run a docker container via docker-compose on a droplet, but finding I’m not able at all to access the container from on the droplet (with curl). I followed this guide to install Docker, plus I added docker-compose.
Here’s what my docker-compose.yml looks like:
version: "2.1"
services:
sonarr:
image: ghcr.io/linuxserver/sonarr
container_name: sonarr
environment:
- PUID=1000
- PGID=132
- TZ=Europe/London
volumes:
- ~/docker/configs/sonarr:/config
ports:
- 8989:8989
restart: unless-stopped
It starts up fine, if I open a shell on the container I can see the service is running and curl it with localhost:8989. But then from outside the container (on the droplet), curl localhost:8989 returns with ‘Connection reset by peer’
I’ve tried running this exact config on a local server also running Ubuntu 20.04 and it all works as expected, I can curl from outside the container and get the response from inside (although that’s running Docker v19 but I hope that wouldn’t affect it?). All I can conclude is it’s something to do with a firewall or iptables or something on the droplet? But I’m not trying to even access it externally, purely from on the droplet.
Any advice? Thanks!
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!
Hi there @dwm,
I could suggest a couple of things:
netstat -plant | grep 8989
If not, I would recommend checking your container logs to see what might have happened.
ufw allow 8989
Let me know how it goes! Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
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
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.