Menu

Gray Matter

Close

Creating a Website From Scratch on a DigitalOcean Droplet

RT Cunningham | November 20, 2020 (UTC) | Blogging, Computers, Web Development

website from scratchYou can choose to believe this or not: I’ve written this as an outline of the things I would need to do to create a website from scratch should I ever have to do it all over again. My memory isn’t reliable enough.

Sure you can set up a website on a hosted service but you won’t have complete control of every process involved. That may or may not matter to you but I read a lot of horror stories over the years about content mysteriously disappearing. Or taken down by a hosted service. It never happened when the person involved had complete control over it.

Web Hosting Services

As you can plainly see in the title, I use DigitalOcean to host my websites. All I need is a $5.00 (USD) per month droplet. “Droplet” is a fancy name for virtual private server or VPS, much like those that existed before the term “cloud” became a thing. You don’t have to use DigitalOcean or any service I might recommend. Whatever you choose is fine as long as you refrain from using managed hosting.

All you need it root access via SSH with a username and password. If you can do everything you need to do without having to go through some control panel, other than network level configurations, then your hosting service is as good as mine.

One of the reasons I like DigitalOcean is because of the firewall at the container level. That means I don’t have to worry about most miscreants below that level. Another reason is because of all the tutorials.

The droplet, or VPS, is the hardware server, which differs from software servers. Everything from here on out is about software servers and the scripting engines used in conjunction with them. At this point, you should have a VPS set up, with an internal domain name you can access with your web browser.

The Operating System

DigitalOcean, like other cloud service providers, allows you to choose your operating system. I always use the latest version of Ubuntu Server. I do all my web development on my laptop computer, which has Linux Mint Cinnamon installed on it. It’s still Ubuntu behind the desktop environment.

Before you continue, you need to set up your real domain name and point it to your VPS. There are plenty of registrars available. I use name.com today but I’ve used others in the past. I’m probably going to say this a lot, but the choice is yours.

The Web Server

There are a lot of web servers available, the most popular being Apache and Nginx. Again, the choice is yours. I’m not offering a tutorial on setting any of them up. If you search for instructions with your preferred search engine, you’ll run across tutorials from several hosting providers, including DigitalOcean. The key is to make sure the tutorial matches the web server for your operating system version.

The applications you choose to run on the web server can help you decide which web server to run. Some applications have very good instructions for one web server and yet have next to nothing on any others. The applications also help you to determine what other software servers to run.

The Database Server

If you want to run WordPress or a lot of other content management systems like it, you’ll have to run a database server. WordPress uses MySQL exclusively, but you can use MariaDB as a drop-in replacement. If you can find a CMS that uses SQLite and you like it, go for it. Database servers use a lot of memory and if they’re not configured properly, they can cause your web server to grind to a halt.

This website, Gray Matter, doesn’t use any kind of database server. Even the static site generator I use (which I designed) doesn’t use a database server. I use clever scripts to accomplish necessary tasks.

The Scripting Engines

A lot of content management systems use PHP as their scripting engines. Others use scripting engines that are JavaScript-based, node.js being the most obvious. Although it would be difficult, you could get away with using no scripting engine at all. That is, until it becomes too painful to interface with a database server without one.

Other Components

There are other components most people want to use with their websites. With these components, there are alternatives.

WordPress and other content management systems have their own commenting systems, but you don’t have to use them. Disqus is a hosted alternative that works well enough, especially when it comes to spam. I think I’ve seen no more than a single spam comment get through to my moderation panel in the last year.

Many people believe they need a full-blown mail server. I guess it depends on how much domain-specific e-mail and comments they expect to receive. You can get away with using a fake MTA in most cases.

Tutorials

I offered tutorials in the past, producing lengthy articles no one seemed to read. If you need instructions, and most people do, you should really find them at the web hosting provider websites. They’re more likely to be up-to-date than anything I post.

Use your search engine and search for terms like these:

Search engine queries like these will lead you to the tutorials you need to follow.

Image Attribution: lewing@isc.tamu.edu Larry Ewing and The GIMP / CC0

Share: Facebook | Twitter

These Posts May Also Be Interesting:


Gray Matter
Copyright © 2020
RT Cunningham