Bobcares

How to open port 8080 in DigitalOcean – 3 Common issues fixed

by | Dec 19, 2018

Hosting applications like Tomcat, Jenkins, etc. will require your DigitalOcean Droplet to allow connections on port 8080.

This requires Droplet firewall modification. At times, even after changes in firewall, the application can fail due to improper firewall set up.

At Bobcares, we help cloud server owners to configure the firewall as part of our Managed Cloud Services.

Today, we’ll see how we open port 8080 on the Droplet, common errors along with their fixes.

How to open port 8080 in Droplet?

In DigitalOcean Droplets, installing common services like web server, mail server, etc. do not need further firewall changes. That means, when the service starts, we can connect to port 80, port 25, etc.

But, that is not the case with custom ports like 8080. They need to be opened in firewall.

Firewall modifications are really critical. Any bad firewall rules can mess up the working of the entire server.

Now, let’s see how our Cloud Specialists open up the port 8080.

 

1. Using UFW

All DigitalOcean Droplets usually come with a firewall tool called UFW, or Uncomplicated Firewall. We’ll first see the steps to open port using UFW.

Here, before adding the rule, we first confirm that UFW is active. To see the status, we use :

ufw status

When it is active, the result looks like

root@ubuntu-s-uno-01:~# ufw status
Status: active

Now, we can open port 8080 by the command

ufw allow 8080

The output on successful addition of rule will look like:

root@ubuntu-s-uno-01:~# ufw allow 8080
Rule added
Rule added (v6)

And, it shows in the rule list as:

root@ubuntu-s-uno-01:~# ufw status
Status: active

To Action From
-- ------ ----
22 ALLOW Anywhere
8080 ALLOW Anywhere
22 (v6) ALLOW Anywhere (v6)
8080 (v6) ALLOW Anywhere (v6)

2. Using command-line

Similarly, we often use command-line utilities to add the firewall rules in the Droplets. For this, we use the command,

iptables -I INPUT 1 -i eth0 -p tcp --dport 8080 -j ACCEPT

This opens up the port 8080 on the server.

Common errors while opening port 8080

Although, the process of opening port 8080 looks really easy, we often get requests from customers about failure of apps on port 8080.

Let’s now have a look at the top errors that we see.

 

1. Server IP not listening

At times, even after adding firewall rule, the server IP may not listen on port 8080.

Here, our Support Engineers check the firewall rules and confirm that rules are added correctly. Often, the “Listen” directive of the application will have only localhost interface in it.

Therefore, to fix the problem, we edit the Listen entry of the application config file and replace ‘127.0.0.1’ as ‘0.0.0.0’. Now, the main IP also starts listening.

Again, we confirm this by telnet command. On successful connection on main server IP 165.xx.1×6.65, the results look like:

$ telnet 165.xx.1x6.65 8080
Trying 165.xx.1x6.65...
Connected to 165.xx.1x6.65.
Escape character is '^]'.

 

2. Application not showing in browser

Another common problem is that application do not show up in the browser. For example, the Tomcat application pages shows timeout error.

In this case, our Cloud Engineers first check and confirm the process running on port 8080 using the command,

netstat -plan | grep :8080

Usually, some other program will be using that port. And, this causes Tomcat service to fail.

To fix, we check the alternate processes and kill those that shouldn’t be running. Then, we restart Tomcat service and the pages show up correctly.

 

3. Cannot connect on 8080

Even when the firewall rules, service configuration, etc. are correct, customers can have problems with port 8080 connection.

Most common reason for this will be firewall restrictions at user’s computer.

Here, we isolate the problem by checking the connection from an alternate location. When connection works from a new location, it clearly indicates that problem is at user’s side. Therefore, we suggest customers to tweak their home network firewall.

[Is application on your Droplet not working ? We can make it work on port 8080.]

 

Conclusion

The process to open port 8080 in DigitalOcean Droplet is rather easy. However, bad firewall rules can affect connectivity to the server. Today, we saw how our Cloud Engineers open the port and correct the common problems with port 8080 connectivity.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

SEE SERVER ADMIN PLANS

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF