Publishing a website
Once you've finished writing the code and organizing the files that make up your site, the final step follows, namely uploading the site online so it can be accessed by users.
What are the options?
Publishing a website is not a simple topic, especially since there are so many different ways to do this. In this article I'm not trying to explain and exemplify all possible methods. Rather, we will discuss the pros and cons of three strategies from a beginner's point of view, then we will go through one of the methods.
Getting hosting and a domain name
If you want full control over your published site, then you'll need to spend some money to purchase:
- Hosting – space for files, rented from the hosting company's web server.
- A domain name – the unique address where people can find your site, such as http://www.example.org/. You can rent the domain name for at least 1 year or for an unlimited period from a domain registrar.
Many professional websites go online this way.
Additionally, you'll need an FTP (File Transfer Protocol) program to actually transfer the website files to the server. Connecting FTP programs to the server varies greatly, but generally, you need to connect to your web server using details provided by your hosting company (for example, username, password, host name). Then the program shows you the local files and the web server files in two windows so you can transfer them from one side to the other.
Using an FTP program is not absolutely necessary. There's also the option of archiving (ZIP archive or another accepted archive type), uploading the archive to the hosting account and then extracting the files.
Tips for buying a domain and hosting
I'm not promoting any specific commercial hosting companies or domain name registrars here. To find companies that offer hosting and registration, you just need to search for “web hosting” and “domain name”. All registrars will have a feature on their websites that allows you to check whether the domain name you want is available or if someone else has already registered it.
Your home or office internet service provider may offer limited hosting for a small website. The set of available features will be limited, but it might be perfect for a small site.
There are also some free services, such as SimpleSite, Neocities, WIX, WordPress and others. Again, you get what you pay for, but they're ideal for your initial experiments. Also, free services don't require FTP software to upload files.
Many companies provide both hosting and the option to buy a domain in a single package. Also, if you choose a slightly more expensive hosting package, you'll receive a free domain for a limited period (1 year). If you carefully study as many offers on the market as possible, you can sometimes find great deals.
Using an online tool like GitHub or Google App Engine
Some tools allow you to publish your website online:
- GitHub is a “social coding” site. It allows you to upload code repositories for storage in the Git version control system. You can then collaborate on projects, and the system is open-source by default, which means anyone in the world can find your code posted on GitHub, use it, learn from it, and improve it. GitHub has a very useful feature called GitHub Pages, which allows you to expose your site code directly on the web.
- Google App Engine is a powerful platform that allows you to build and run applications on Google's infrastructure — whether you want to build a multi-tier web application or host a static website. For more information visit:Google App Engine
These tools are usually free, but you'll get access to a limited set of features.
Using an online IDE
There are a number of web applications that mimic a web development environment, allowing you to enter HTML, CSS and JavaScript, then display the result — all on a single page. In general, these tools are quite easy to use, great for learning, and free (for basic features), and they host the rendered page at a unique web address. However, the basic features are quite limited, and the applications usually don't offer hosting space for files such as images.
Try playing around with some of these web applications:
Publishing the website via GitHub
Now I'll explain how to easily publish your website through GitHub, but first you need to get familiar with a few terms:
- git – version control system;
- repository – a git “project” that contains all files and the history of changes;
- commit – a set of modifications/additions/deletions of one or more files within the repository.
- The first step is to create a GitHub account by filling in a username, email address, and password. In the next step you'll need to select the desired account type. The free account is selected by default. Click “Finish sign up”. This is a good time to validate your email address — all you need to do is click the link inside the email received from GitHub.
- Next, you need to create a repository for the files. To do this, click on
+ New Repository.
- On this page, in the Repository name box, enter
username.github.io. Don't forget to check “Initialize this repository with a
README”, then click Create repository.

- Now, drag and drop all your website content into the created repository and click Commit
changes.

- Make sure your folder contains an index.html file.

- Now open your browser and type in the address bar username.github.io to view your site online. In our example, the web address is niky48wd.github.io.
It may take a few minutes for your site to become visible. If it doesn't work immediately, you'll need to wait a few minutes and then try again.
