So you've written some code, and after opening those files in your browser you are able to confirm that those files do indeed make a website. You're super excited to show all your friends and family, but how will other people see it? As of right now, those files are just living in a folder on your computer and it's not very practical to send all your website files to every person who wants to see it.

What you need is a server , a special computer dedicated to housing your files and making sure that people can get them with a few keystrokes. In this lesson, we'll walk you through getting a URL, finding a hosting server, and publishing your site.

Before we begin, you'll need to download:

An FTP program transfers computer files from one host to another via the Internet, such as CyberDuck, and FileZilla.

What we do

We're getting you the URL of your dreams. Maybe. If it's still available.

Why we do

Every address on the web needs to be unique—that way users are sure they're getting the bona fide content they're looking for, and not a different site every time they request the same URL.

How we do

  1. First, search for a domain name to see if it's available. Here are five popular services that offer domain names:
  2. Once you've got something good, pay up. You're purchasing ownership on a monthly or yearly basis. And you're buying the rights to the name—nothing more.

These sites offer a lot of additional services that you don’t necessarily need. Don’t be tricked into buying anything you don’t need just because they sound fancy—domain registrars are businesses after all, and they’re looking to make money off of you. Here’s a list of common features that registrars often try to bundle with your domain. You can decide for yourself whether it sounds like you need it.

Hosting
For a simple website, like a portfolio site or personal webpage, using the domain registrar’s hosting may be the simplest option. As you go on to develop bigger, more complex projects (especially those that require server-side scripts), you’ll probably want to look toward other hosting options.
Local listing
Listing a site locally makes it easier to find a website by putting it on search engines such as Yelp, GoogleMaps and FourSquare. If your website is for a business, local listing might be a good idea to attract new customers. It’s probably not your priority for a portfolio or personal site, but that’s up to you.
Private Email
Most domain registrars will offer email forwarding for free, which allows you to forward all emails sent to a specified address on your website to a pre-existing email account. This keeps everything centralized, you can continue to use whatever email provider you want, and you don’t have to pay a penny (or you shouldn’t, at least. If your domain registrar tries to make you pay for email forwarding, try looking elsewhere).
Sub-domains
Sub-domains come before your main domain name, such as shop.mydomain.com. These label different areas of your website, like an online store or blog. Many domain registrars allow you to register subdomains for free, but you’ll have to point or forward those domains to different websites as well.
Positive SSL
SSL, or Secure Sockets Layer, is the difference between http and https in front of a website’s URL. It's a way of encrypting websites so that everything sent between a client and the server your website is hosted on can’t be intercepted. If you’re collecting sensitive information on your website, like credit card information, you should invest in SSL.
Website forwarding
When you enter the URL www.newyorktimes.com into your browser, you're rerouted to the actual domain and website, www.nytimes.com. This is website forwarding. Forwarding ensures that commonly mistaken URLs will automatically go to the correct one, rather than giving the user a wrong or nonexistent page. Website forwarding is a good idea as your brand expands, especially if you are known by different names (such as an acronym). The kicker is, of course that you’ll have to purchase those other domains as well.
WhoisGuard
When you register a domain, you have to provide certain details about yourself, like your name and email address. This information is public and can easily be accessed by spammers through sites like who.is. WhoisGuard is a company that masks your personal information with their information, protecting you from spam.

What we do

A server hosts your website so that it is available and accessible on the Internet.

Why we do

These companies allow you, the client, to lease out space to publish your site onto the web on a monthly basis.

How we do

Servers work by uploading your files using a File Transfer Protocol (FTP) client so that all your code, images, and other files are readily accessible to each other.

Depending on the size of your website, you may have to sort through which hosting server is the best option for you. Most free hosting servers have limited services, will put ads on your site, and cannot host complex or large sites. Plus: virtually no customer service, since you're not a paying customer.

There are also free solutions to web hosting. One popular option is GitHub Pages , which is perfect for hosting a one-page, static website like a personal website or a landing page. While you won’t have access to a server and therefore won’t be able to run any sort of server-side processes, it should be enough for a simple website. You can even set up your domain to point to your GitHub Page and mask the DNS to show your domain name.

Once you’ve registered your domain name and purchased a hosting server, you will need to link the two in order for the URL to direct to the correct website. Most registrars lay out a clear process in connecting the domain name with the host, but in general you’ll just be pointing your domain name as the address to the IP address of the server where your files will be hosted.

In these steps, we’ll be assuming here that you’ll be logging into your server using SFTP, but if that’s not the case, you should look up a guide for whatever protocol you have on your server.

In FileZilla, open the Site Manager by going to File > Site Manager. This should bring up a window with a bunch of fields for you to fill out. The only things you need to make sure you have are the host (which is the IP address of the server you’re connecting to), the protocol, the logon type (which should be normal), and the user and password fields to your account. After filling out those fields, move over to the “Advanced” tab and in the Default remote directory field enter “/var/www/html.” This will just make it easier for you to get to the directory where you’ll be uploading your files. From here, you should be able to log in.

In Cyberduck, when you launch the application for the first time you should see a set of pre-loaded bookmarks. You can go ahead and delete those – you’ll be adding your own bookmarks soon. Right-click on the screen and create a new bookmark, and you’ll be prompted to enter the information necessary to connect with the server. Fill out everything at the top of the screen, making sure not to check “Anonymous Login,” and then click “More Options.” In the “Path” field, enter “/var/www/html.” This will just make it easier for you to get to the directory where you’ll be uploading your files. Once you’ve done that, close out of that window and double-click on the bookmark you just made. Enter your password to connect to your server, and you should be in!

Once logged into FileZilla, you should have six windows: one on top, four in a two-by-two layout in the middle, and one on the bottom. The top window (1) is where you’ll get status reports on your connections to the server. The middle left windows (2, 4) are your local directory – they’re the files sitting on your computer. Then your middle right windows (3, 5) will have the directory for your server. The bottom window (6) has useful information about any files you have waiting to be uploaded and their status. To upload your files, simply locate them on your computer in the left middle bottom pane and then drag them over to the right middle bottom pane. Make sure that you upload your HTML file as well as any important other files (CSS, images, etc.) into this folder exactly as it appears on your computer.

In Cyberduck, once you’ve connected to your host server it should direct you to a new screen. Make sure that you’re in the /var/www/html directory, and from here you can just drag and drop your files from your computer into Cyberduck. Voila! That’s it!

Now that your website is live, check it out! Make sure to click on all of the links to make sure that they are directing to the right places and that all the images are showing. If you have to fix anything, be sure to re-upload the edited file onto your hosting server.