By wsm1992
I can access my host with browser using 80 port, but I get Connection refused when I access my host with other port (like 8080, 81, 82…). How can I expose more port to access my services?
the output of netstat -lnp as below:
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 28886/php-fpm.conf) tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1666/sshd tcp6 0 0 :::3306 :::* LISTEN 15739/docker-proxy tcp6 0 0 :::2222 :::* LISTEN 14782/docker-proxy tcp6 0 0 :::8080 :::* LISTEN 15942/docker-proxy tcp6 0 0 :::80 :::* LISTEN 15161/docker-proxy tcp6 0 0 :::22 :::* LISTEN 1666/sshd tcp6 0 0 :::443 :::* LISTEN 15150/docker-proxy
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!
Hello,
If you have your UFW enabled, you can open ports with the following command:
sudo ufw allow 8080
Also I can see that you are using Docker, you need to make sure that you expose the port that you are trying to access, for example:
docker run -d -p 8080:8080 ID
This would expose port 8080 on the host and forward it to the container.
Hope that this helps! 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.