How To Set Up A Self-Hosted WordPress Site

wordpress-logoOne thing I have learned is that it pays to know the why as well as the how when building things.

And that especially applies when you build your first WordPress site because a lot of what you do is invisible to the eye.

With websites, you do X and then Y happens but it’s not obvious what is happening – unlike when you change the tyre on a car where you can see the nuts spin off.

Knowing the why saves a lot of confusion when you have information whirling around in your head.

Background

I set up my first self-hosted WordPress website in 2007, and I’ve set up more than 20 websites since then.

I’m not a developer or a coder: I just set up my own websites and use them. But I am the kind of person who likes to take a step back and get an overview – and I am happy to pass that information along here.

I’ve set up sites using Textpattern, GetSimple, and other systems, but I keep coming back to WordPress.

This site is built on WordPress.

WordPress Comes In Two Versions

One of the things that confuses people is that there are two versions of WordPress. One is the self-hosted version that you set up on space that you rent on a commercial web host, and that’s what I am going to be talking about here.

The other version is WordPress.com – and it is hosted on WordPress’s own web servers.

WordPress.com is completely free to use and all the back end, technical stuff is dealt with by the WordPress people, and your content is backed up automatically.

You also become part of a community of people using WordPress.com

The disadvantages are that you don’t have full control. You can only use the themes that WordPress.com allows; you cannot add your own plugins or modify the code; and you can’t run your own adverts on your site.

Of course, it doesn’t have to be an either-or situation. You can set up a site on WordPress.com and you can also set up your own self-hosted WordPress site.

What some people do is to start with WordPress.com and then later on when they feel comfortable with the navigation menu and how to write posts and style their site, they move to their own self-hosted site.

The Self-Hosted Version Of WordPress

I didn’t understand much when I built my first WordPress site.

I was worried in case I did something that would mess up the site before I’d even started blogging.

I read the WordPress installation guide and I knew what I was supposed to do but I didn’t have an overall picture of what I was doing.

What this article does is help you understand how it all hangs together – to give you the big picture.

I recommend that you read the installation guide on the WordPress site and then come back here and read the rest of this article before actually starting.

OK – let’s get going.

The bundle of WordPress files from WordPress.org (notice that it’s WordPress.org and not WordPress.com) is free to download to your computer.

Then it’s up to you to buy a domain name and rent some space on a commercial web host so that you can run your WordPress site.

What WordPress Is

WordPress is a system of files that can be used to show information on the Web.

Part of WordPress is about the design and layout of your site – including such things as the colours, the typography, the columns at the side, the menu bar across the top.

Another part of WordPress is a way for you to write content – articles and photos.

The text and photos are stored separately in a database on the web server.

When a visitor views the page, WordPress pulls the information from the database and styles the fonts and the layout and presents it to the viewer.

I think it’s pretty amazing that a web page self-assembles to order in a fraction of a second when a visitor wants to look at it. Don’t you agree?

That happened when you came to this web page to read this article. The text was pulled from the database and then WordPress styled the fonts and the layout of the page.

So WordPress is a layout and it is also a method of arranging content that is pulled in from a database.

And it’s also a set of built-in rules that enable you, the owner of the site, to go into the back end and add content without having to write code, and then to publish it.

What makes WordPress attractive is that you can type in the back end without having to write lots of code like ‘make a new line’ or ‘ make this a heading’ and the system will interpret what you write.

This is what WordPress looks like in the back end where you write your articles, upload images, etc.

Wordpress admin panel
This Is The Admin Panel

When you build your site, you set up a database and give a set of secret keys to your WordPress files so that the two can communicate.

You don’t have to worry about how to make a database. Your web host has systems in place for you to do that. You just have to decide on a few names and the web host will build the database for you.

Then the WordPress software will create a set of tables inside the database. There is a table for articles, a table for comments, and table for your user information, etc.

WordPress Themes

As theme is a framework for displaying the information on the screen, and WordPress comes bundled with a couple of themes.

WordPress has to come bundled with at least one theme or there would be no way for WordPress to present the information on the screen.

Once you are up and running, you can search out lots more free themes in the official WordPress theme repository. There are also lots of paid-for themes built by various individuals and companies.

There are some reputable individuals out there making beautiful themes. They sell them, so you will not find their themes in the WordPress repository. Instead, you will pay for their themes and then download them and upload them to your site. There’s no problem with that.

There are also some reputable people making plugins that enable you to do clever things like send snippets of your posts to Twitter automatically, or create a sitemap to send to Google. The list of plugins is endless.

Just be aware that there are also some malicious sites selling or giving away themes and plugins.

If you use those you could upload a virus to your website. So stick with reputable places.

Web Hosts

So now that you know that WordPress contains a couple of themes and all the information to build a site, and that it needs a database to run it, where do they go? Where do they reside?

Believe it or not, they could if you wanted be run from your computer. You could run a web server and pump out your website to the world from your living room.

But most people don’t do that. Instead, they pay a hosting company to host their website on the hosting company’s computers. You will hear people talk about ‘servers’, and they mean the computers and the software that can run websites and push stuff out onto the web.

So you need a web hosting company. There are web hosting companies all over the world. It’s probably best to choose one that is in the country where you are and the visitors to your website are likely to be from.

On the other hand, US web-hosting companies tend to offer a lot for what you pay, so that’s maybe a reason to choose a US hosting company.

Not all web-hosting companies are equal in reliability. And not all of them are set up to run WordPress, although many are. So choose wisely. You can check their specs against the WordPress requirements and WordPress has a list of web hosts that it recommends.

You need a domain name

You need a domain name. Something that ends in .com or .net or .info or .co.uk or maybe .ly or .me

There are lots of domain name options. Some of them aren’t available to you. For example, you have to be the UK government to have a domain that ends in .gov.uk

Some people think that the domain name is the website. But it isn’t – it’s just the name.

OK. Time for a checklist. You need a web hosting company and you need a domain name that has been registered with a domain registrar.

Some web hosts are set up with software that runs a little program that installs WordPress for you with a couple of clicks.

But let’s assume you are going to handle it all yourself.

You need WordPress

What else do you need? You need the WordPress files.

If you are going to do this thing, why not download WordPress now so you have it on your computer ready for use?

Now what you need is a way to get the files and folders into the administrative area of your website.

You need FTP software

You will need FTP (file transfer protocol) software to upload the WordPress files from your computer to your web host.

fetchThere are lots of FTP programs you can download. I use a program called Fetch because I am on a Mac and it is built for the Mac.

I also use it because it has a little dog that runs back and forth when I upload files and it barks when the upload is complete – it really does.

Cyberduck is good too. It’s free (actually, it’s donation ware, which means it’s up to you whether you donate) and it runs on Macs and PCs.

So now you have a domain name, an FTP program, a web host, and the WordPress folder full of files and smaller folders.

You need a text editor to edit the WordPress files

You are also going to need a way to look inside the WordPress folder and add a couple of bits of information to one of the files. You need something that can open and edit php files. If you’re on a Mac, Textwrangler is free.

I’m not the person to ask about text editors for Windows PCs, but I just googled for it and found Notepad++.

DNS – Domain Name Servers

If you register your domain with a domain registrar and then host your site with a web hosting company, you are going to have to change the DNS servers at the domain registrar. This probably sounds like something from Startrek if you haven’t heard of it before.

The DNS bit might sound scary, but it’s just an address. For example, if you register your domain name with GoDaddy then when people write your domain name (such as www.mysite.com) in their browsers, the internet will go looking for your site at GoDaddy.

But if your domain name is care of GoDaddy and you run your site on a web host like Dreamhost, then the address should be care of Dreamhost.

So you have to go into your account at GoDaddy and change the DNS (the ‘care of’ address) to Dreamhost.

However, if you use a host that is also a domain registrar, then you won’t need to change the DNS because the address will already be correct.

And while you are asking, yes, Dreamhost is a domain registrar as well as a web-hosting company.

Now you are all set.

Start with the database.

When you signed up with your web host it granted you access to some kind of interface that is private to you. There are various kinds of interfaces. Some web hosts use an interface called cPanel. It’s used by a lot of web hosts.

Whatever interface your web hosting company uses, go into the interface and make a database and a hostname.

There will be instructions how to do it, and it is not difficult.

When you have done it, you will have database and your own private username and password so that only you can add information to certain parts of the database.

You are then going to put this information into one of the files (the config file) in the WordPress folder on your computer and then you are going to rename the file.

Once you have read through to the end of this article, it’s a good idea to go to the install guide on the WordPress site and it will guide you through the install.

In a nutshell though, it is going to tell you to look in the folder that you downloaded from the WordPress site. Now use your text editor to open the file named wp-config-sample.php and add the hostname etc. information in the spaces provided.

Then rename the file to wp-config.php and save it on your desktop.

Now use your FTP software to upload all the folders and files that are inside the main WordPress folder to your web host. Don’t upload the WordPress folder itself. Upload all the files and folders that are inside the WordPress folder.

You don’t need to upload the wp-config-sample.php file butt you must upload the config.php file that you made because that contains the keys that enables WordPress to communicate with the database that you made.

Then there are a couple more small and simple steps described in the install guide, and if everything goes OK, you have a new website!

As a final note, here are some useful things to do as soon as you have set up your site.

Setting permalinks

For time-sensitive articles it might be a good idea to have the year, the month, and the day, as part of the URL for each post. The downside is that the URLs can get very long.

And for articles that have ‘evergreen’ content, shorter permalinks are probably better.

Whatever kind of permalinks you decide you want, you probably don’t want the default permalinks that Worpdress sets when you set up your site. An example of a default permalink would be something like mysite.com/?p=4 – which doesn’t tell your readers anything.

You can read about permalinks on the Worpdress site.

Controlling comments

The next thing you want to do is make sure that you control who can comment on your articles. Go into ‘Discussion’ in the sidebar of the Admin page of the dashboard and make sure it is set so that an administrator (that’s you) has to approve comments before they are published.

Not doing that is an open invitation to spammers to come in and leave their stupid comments full of links to things you don’t want to link to.

thank you for reading this. if you liked it, please share it.

    Comments

    1. says

      Very useful, thank you David.

      I have my posts’ permalinks set to date/year etc for the first site I had set up and I really regret it. I believe it’s possible to change them but I’m not exactly sure what the process is and with over 500 to change I think I might just leave them as they are now! I’ve been using WordPress for about four years, but very often I’m still afraid to touch anything in case I break it :-)

      • David Bennett says

        Hi Angela,
        I recently changed the permalink structure on one of my sites.

        I have over 400 articles on the site and my heart was in my mouth when I made the change.

        I knew the change would work, but I wasn’t sure what would happen to all the inbound links that were leading to the URLs.

        I needn’t have worried. After I made the change, I tested it with one of the old URLs to see what would happen.

        When I went to that URL, e.g. mysite.com/year-month-date/post-name, some internal magic in WordPress redirected all the URLs to the new structure of mysite.com/post-name

        I don’t know what happen if two articles have the same name. I guess the permalinks would change to post-name and post-name-1 so that the redirects would still work.

        It’s straightforward to change permalinks. In the Admin page, go to Settings > Permalinks and change it there. I was a bit put off when I first set my own permalinks using the %post-name% setting. The percentage marks looked scary. But now I see they are just a language for delineating permalinks.

        I keep my WordPress version up to date. I don’t know how clever old versions of WP are at redirecting permalinks.

    2. says

      That’s a terrific article … hats off, for writing it!

      The ‘why’ I need to ask myself is merely; ‘why do I want a web site?’ I should have something to fill it with :)

      I’ve had several self-hosted WP-blogs, but never went through that whole procedure … I just let GoDaddy (which was my domain host before) do it. It’s always tempting to go back to self-hosted, but I hold myself back. The WP-community is more important to me, than having fun with the design and plugins.

      • David Bennett says

        I wrote the article in response to someone who asked me to help them set up a site. They had read the install guide and felt mystified. So I started to write an email to explain it, and it turned into an article.

        I agree that the community on WP.com is important. It’s how we met :-)

        For some things, self-hosted is the only way to go. For example, we are just setting up a blog built on WordPress, and it is on a sub-domain of our new e-commerce site, so it has to be self-hosted. I’ll send you details when we go live ;-)

    Leave a Reply

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

    CommentLuv badge