iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
To run an Ubuntu website on port 8080 (or another TCP port), configure the web server to listen on that port, make the site’s virtual-host or server-block declaration match it, allow the same port through every firewall between the client and server, and include the port in the URL. For example, visitors use http://example.com:8080/, not just http://example.com/.
This guide covers Apache2 and nginx, UFW, cloud security groups, router NAT, IPv6, testing, HTTPS implications, and the failure modes that make a site work locally but not from the internet.
What a non-standard HTTP port changes
HTTP commonly uses TCP port 80, while HTTPS commonly uses TCP port 443. A non-standard HTTP port is any other TCP port, such as 8080, 8000, or 81. The number itself does not make traffic private or encrypted; it only identifies which listening socket should receive the connection.
DNS still maps a name such as example.com to an IP address. The explicit port in the URL then selects the service at that address. If you omit the port, a browser assumes the protocol’s default (80 for HTTP or 443 for HTTPS). Users therefore need a URL such as http://example.com:8080/ unless another service on port 80 redirects them.
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.
Ubuntu describes an open port as a network port bound to a service and actively listening for incoming connections. Exposing such a port on an untrusted network creates risk when the listening software is vulnerable or misconfigured. Open only the port you need and keep the web server and operating system updated.
Plan the port before changing configuration
Choose an unused TCP port
Pick a port above 1024 that is not already assigned to another service; 8080 is a common example. Avoid choosing a port merely because it is popular: availability on your host, cloud provider, and network still has to be checked. Record whether the service should listen on IPv4, IPv6, or both.
Check for conflicts
Run this command on the Ubuntu server:
sudo ss -ltnp
The -l option shows listening sockets, -t limits the output to TCP, -n keeps addresses and ports numeric, and -p displays the owning process when permitted. Look for an existing entry ending in :8080 (or your selected port). If another process owns it, choose a different port or deliberately reconfigure that service first; two processes cannot normally bind the same address and port.
Decide which addresses should listen
A listener bound to 127.0.0.1 accepts local requests only. A listener bound to a server’s public or wildcard address can receive external traffic, subject to firewalls. If you want internet access, make sure the web-server directive does not accidentally restrict the service to loopback. If the host has IPv6, configure an IPv6 listener as well when the DNS name has an AAAA record; otherwise some users may reach a different result over IPv6.
Run Apache2 on a custom port
1. Set Apache2’s listening port
Apache2’s primary port setting is /etc/apache2/ports.conf. Ubuntu documents the Listen directive as specifying the port and, optionally, the IP address on which Apache2 listens. The default is commonly Listen 80; add or change a line for your selected port:
sudo editor /etc/apache2/ports.conf
Listen 8080
Keep a Listen 80 line only if another site or an HTTP-to-HTTPS redirect still needs port 80. Removing it stops Apache2 from accepting connections there.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsRank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
2. Match the virtual host
Apache chooses a virtual host using its address-and-port binding and, when supplied, the ServerName or ServerAlias. Edit the site file in /etc/apache2/sites-available/ and use the same port in the opening tag:
<VirtualHost *:8080>
ServerName example.com
DocumentRoot /var/www/example
<Directory /var/www/example>
Require all granted
</Directory>
</VirtualHost>
If the site is already enabled, edit its existing file. Otherwise enable it with a2ensite and disable any test site that could become the default for that port. The ServerName should match the hostname visitors use; a request to an unrecognised name can be served by a different enabled virtual host even when the port is correct.
3. Validate and apply the change
Check the configuration before reloading so a syntax error does not leave the service unavailable:
sudo apache2ctl configtest
When the result reports that the syntax is valid, apply the change without unnecessarily stopping existing connections:
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallsudo systemctl reload apache2
If the reload fails, inspect the service status and journal, correct the reported file or directive, run the configuration test again, and reload only after it passes:
sudo systemctl status apache2
sudo journalctl -u apache2 --no-pager -n 50
4. Confirm Apache owns the port
Run sudo ss -ltnp | grep ':8080' and verify that the Apache process is listening on the expected address. A successful local request proves that Apache can answer on the host:
Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
curl -I http://127.0.0.1:8080
A status such as 200, 301, or 302 shows that an HTTP response was generated. A 404 means the request reached Apache but the selected site or document path did not contain the requested resource; it is not evidence that the port is blocked.
Run nginx on a custom port
1. Change the server block’s listen directive
nginx selects a site with the listen directive and then uses server_name to match the hostname. Edit the relevant file under /etc/nginx/sites-available/ (or the included configuration location) and change the listener:
server {
listen 8080;
listen [::]:8080;
server_name example.com www.example.com;
root /var/www/example;
index index.html;
}
Use the IPv6 line when the site should accept IPv6 connections. If you configure several sites, give each site an appropriate, distinct listening port or a deliberate combination of addresses and names; duplicate or conflicting listeners can prevent nginx from loading.
2. Enable the site and test syntax
When the file is not already enabled, create or update the symbolic link in /etc/nginx/sites-enabled/. Then test the complete nginx configuration:
sudo nginx -t
The test checks syntax and referenced files. Fix every error it reports before applying the change. A common mistake is editing a file that nginx does not include; nginx -t helps reveal the active configuration path, and the effective configuration can be inspected with:
sudo nginx -T
3. Reload and verify
Reload nginx after a successful test:
sudo systemctl reload nginx
Confirm the listener and make a local request:
sudo ss -ltnp | grep ':8080'
curl -I http://127.0.0.1:8080
If nginx returns the wrong site, check the exact server_name, the enabled-file links, and the order and specificity of the server blocks. The listener can be completely functional while hostname matching selects an unintended root directory.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
Allow the port through Ubuntu’s UFW firewall
Changing the web-server listener does not open the host firewall. Ubuntu’s uncomplicated firewall (UFW) is a common firewall frontend. Allow the selected TCP port explicitly:
sudo ufw allow 8080/tcp
Before changing a production firewall, preview the rule with:
sudo ufw --dry-run allow 8080/tcp
Inspect the active policy and numbered rules:
sudo ufw status
sudo ufw status numbered
The rule must specify TCP. An allowance for UDP 8080 does not permit HTTP, which uses TCP. If you use a different port, substitute that number consistently in the web-server configuration, UFW rule, cloud rule, NAT rule, tests, and visitor URL.
Do not remove your existing SSH rule while working remotely. A firewall change that locks out SSH can require console access from the hosting provider or a physical administrator to repair.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Open the same port outside the Ubuntu host
Cloud security groups and network ACLs
A cloud instance can have several filtering layers. Add an inbound rule for TCP 8080 (or your chosen port) to the instance’s security group, firewall policy, or network ACL. Restrict the source CIDR to trusted networks when the site is private; use a broader source only when public access is intentional. The cloud rule cannot make a service reachable if Apache2 or nginx is listening only on loopback, and a correctly listening service remains unreachable if the cloud rule blocks it.
Home and office routers
For a server behind a router, create a port-forwarding (NAT) rule from the router’s public TCP port to the Ubuntu machine’s private IP and the same destination port. Reserve the server’s private address so the rule does not break after DHCP changes. If the ISP uses carrier-grade NAT, inbound forwarding may not be possible without a public address or an alternative access method.
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Provider or network port blocks
Some hosting providers, corporate networks, and internet service providers filter selected inbound or outbound ports. If the host is listening and local tests succeed but an external test times out, check the provider’s permitted-port policy and the network path before changing application files.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Test from inside and outside the server
Local test
Start on the server itself:
curl -I http://127.0.0.1:8080
This isolates the application from external firewalls. If it fails, inspect the listener with ss, validate the web-server configuration, and review the service journal.
Free tools Windows power users keep installed
One-click scans. No signup required.
Remote test by name
From a different network, request the public hostname and explicit port:
curl -I http://public-name.example:8080
Testing from a mobile connection or another site avoids false confidence caused by a router that supports local hairpin access differently from internet traffic. You can also test the public IP directly, but hostname testing is important because virtual-host or server-block selection depends on the Host header.
Interpret common outcomes
- Connection refused: no service is listening on the requested address and port, or a firewall is actively rejecting the connection. Check
ss, the service state, and listener addresses. - Timeout: traffic is usually being dropped by UFW, a cloud security group, a router without the correct NAT rule, or an upstream provider.
- 404 or the wrong site: the request reached the web server, but virtual-host/server-block matching, the hostname, document root, or application route is wrong.
- Works on 127.0.0.1 but not on the server’s LAN address: the service may be bound only to loopback, or a host firewall rule may block the interface.
- HTTP response redirects unexpectedly: inspect the site configuration and application base URL. A redirect is an application or web-server rule, not proof that the custom port is inaccessible.
Keep Apache2 and nginx settings aligned
| Configuration concern | Apache2 | nginx |
|---|---|---|
| Port directive | Listen in /etc/apache2/ports.conf |
listen in a server block |
| Site matching | Virtual-host address/port plus optional ServerName and ServerAlias |
listen selection plus server_name |
| Configuration check | sudo apache2ctl configtest |
sudo nginx -t |
| Apply change | sudo systemctl reload apache2 |
sudo systemctl reload nginx |
| Typical role | General-purpose web server with per-site virtual hosts | Web server and reverse proxy with server blocks |
Whichever server you use, the effective listener, site declaration, firewall policy, and upstream network policy must agree. If Apache2 and nginx are installed together, ensure they are not competing for the same address and port; commonly one serves public traffic while the other listens on a separate internal port.
Understand HTTP, HTTPS, and redirects on a custom port
Port 8080 remains plain HTTP unless you explicitly configure TLS. Moving HTTP away from port 80 does not provide encryption, authentication, or certificate validation. Ubuntu’s nginx guidance treats port 80 as a normal HTTP starting point and port 443 with certificates as the production HTTPS endpoint.
Recommended Free Tools
If you want encrypted access on a non-standard port, configure TLS in the web server and use an https:// URL with that port, such as https://example.com:8443/. The certificate still needs to cover the hostname; the port number does not replace certificate validation.
When redirecting HTTP to HTTPS, make both endpoints explicit. A redirect from port 80 reaches the HTTPS listener only if that listener is configured and permitted. Likewise, a request to http://example.com:8080/ will not automatically redirect merely because port 443 exists. Add a deliberate redirect rule and test it with curl -I so the Location header contains the intended scheme, hostname, and port.
Security and maintenance checklist
- Expose only the TCP ports required by the application; remove temporary rules after testing.
- Prefer a source-restricted UFW or cloud rule for administrative or private sites.
- Keep Apache2/nginx, modules, application code, and Ubuntu security updates current.
- Use a dedicated document root and least-privilege file permissions; do not make the entire filesystem web-readable.
- Review access and error logs for unexpected requests after publishing a new public port.
- Use HTTPS for credentials, sessions, and other sensitive data; a different HTTP port is not a security control.
- Document the chosen port, listener address, firewall rule, NAT mapping, DNS name, and rollback command so another administrator can restore service.
Safe rollback procedure
If the custom port causes an outage, restore the previous listener and site declaration, validate the configuration, reload the service, and then remove the external firewall rule when it is no longer needed.
Quick Recap
- Change Apache2’s
Listenand virtual-host port back, or restore nginx’s originallistenvalue. - Run
sudo apache2ctl configtestorsudo nginx -t, depending on the server. - Reload the affected service with
sudo systemctl reload apache2orsudo systemctl reload nginx. - Verify the original endpoint locally and remotely.
- Delete the obsolete UFW, cloud, and router rules only after confirming that no other service uses the port.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →

