3

I want to know how to make my ubuntu server ip public. I'm not asking for a domain, if people would be able to access my website by ip, it would be great! (just for now) Does someone have an idea how to do this?

0

2 Answers 2

7

Unless you specifically subscribed to a static IP from your Internet Service Provider you most likely have a dynamic IP. That means it's subject to change at anytime without you knowing it. If you publish your site by that IP people may eventually be connecting to a different site when your IP changes.

So if you want your specific computer/server to be available publicly you would first have to get a static IP from your Internet Service Provider (ISP).

Then you will register your domain name (an easy way for someone to access an IP Address... the domain is translated via a DNS server to your IP. This is a service provided by the place where you registered your domain name.

So now people can connect to your computer from the outside by using either the IP or your domain name.

For security and shared IP (using the same IP with multiple computers) your actually computer is separated from the Internet via a router. You can configure your routers (called port forwarding) to send the connection from the outside to your specific computer used for your server.

While there are many type of servers, most likely you are referring to a Web Page Server. This is port 80. So you will configure your router to forward connections from the outside that is trying to communicate to port 80 to your Web Server.

A list of things you might want to look at is:

  • Static IP from Internet service provider
  • Domain registration
  • Router for port forwarding traffic to your desired computer
1
  • @user68186 People are trying to use their Ubuntu for many things. He's trying to do something separate than the average user who might either use his computer for games, accounting, or word processing. Sep 10, 2016 at 11:41
4

I am going to modify my answer for How to securely ssh into a machine at home over the internet.

Web servers run on port 80 by default, so we will be dealing with this for the whole answer.

Also note that some ISPs block incoming connections on port 80 (among others), so you may need to use a non-standard port, like HTTP-Secondary: 8080.

The first thing you want to do is make sure your web server works. Access the server's local IP from on the local network and make sure everything works how you want it.

Once you get that working, the next thing you need to do is set the server to a static local IP. You can set that in System Settings --> Network. Since your router is still assigning IP addresses, it might assign the one you choose to another computer, which will cause a conflict.

To avoid IP address conflicts, tell the router's DHCP settings (or if you have a separate DHCP server, tell it) that the server's IP is taken (reserve it in the DHCP settings).

Now that you have a static IP, you need to configure port forwarding. Most routers have settings for this, but not all. If yours doesn't, you'll need to get another router that does. Find the settings and forward port 80 to the IP address you gave your server.

Now, here's the tricky part. I know you said you don't want a domain, but you might have to get one, since most ISPs give dynamic public addresses. If this is changing constantly, it's going to be hard to give users the new IP every time it changes.

You could ask the ISP for a static public IP, but that probably won't work, especially is that ISP is one who blocks incoming connections on port 80. Instead, you can try Dynamic DNS. Using either your router or a program you install on an always-on computer on the LAN, this service will give you a free subdomain that always points to to your ever-changing IP.

Once you set that up, you can refer people to the subdomain until you get a real domain. If you do get a full domain, you will need to point www and domain.x as CNAME records to the Dynamic DNS subdomain you have.

  • No-IP will give you a free Dynamic DNS subdomain. You will need to install the DUC (Dynamic Update Client) on an always-on computer. Some routers may have an option for integration with this service, but it won't work, as No-IP has discontinued router integration.

  • ChangeIP is another Dynamic DNS solution. You get a free subdomain and a DUC. This one also allows you to use your router instead of a DUC, if it supports it.

  • Freenom. This isn't a Dynamic DNS service, but it is useful, as you will be able to get free domains. They aren't normal .com or .net domains, but they are free.

  • CloudFlare. This is a DNS management and website protection service. It stands between the client and the domain registrar. I recommend using this as well as a domain, since it will be much easier to set CNAME records and point your domain to the subdomain from the Dynamic DNS service.

Of course, if you already have a static IP (I don't know how to tell), then you can ignore all the Dynamic DNS and CloudFlare stuff and just give people your public IP.

Not the answer you're looking for? Browse other questions tagged .