How To Raspberry Pi

How To: Host a Website Accessible over the Internet on Raspberry Pi

A Raspberry Pi 3b+

Do you want to host website on Raspberry Pi with a customised domain on a Raspberry Pi?
I did too, but couldn’t find any guide to do so, hence decided to write one myself.

We’ve covered earlier How To Install a WordPress on a Raspberry Pi, while the tutorial will allow you to install a website on Raspberry Pi. the site is only accessible on your local home network.

So if you want to show your friends your cool website filled with memes, you will need to do more.

In this tutorial we provide a comprehensive Step by Step instructions on how to create your first website on WordPress and make it accessible from Internet.

The Setup – The Software We Will Use

Unlike the earlier tutorial which explained how to install WordPress using Apache web server (using the LAMP Stack), we are going to use Nginx WebServer (using the LEMP stack).

LAMP vs LEMP
Battle of the WebServers!

Why LEMP is a better option for Raspberry Pi?

LEMP Stack To be used to host website on raspberry pi
LEMP Stack

LEMP is an open-source software stack which comprises of Linux, Nginx, MySQL, and PHP, the E stands for Nginx, go figure :).

Nginx vs Apache debate is wide-ranging that we will cover sometime in a future post, but for this exercise, we chose Nginx simply because while Apache can do a lot and has a lot of flexibility and features, Nginx has limited features but is extremely good at what it does. To use an analogy, Apache is a swiss army knife, while Nginx is a sharp cutting knife.

First Step is to Update Rasberry Pi software

0 0 vote
Article Rating
Subscribe
Notify of
guest
6 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Nathan
Nathan
1 year ago

Seems to be working but I’m getting an error “413 Request Entity Too Large” when I upload a theme.

Gaurav
Gaurav
1 year ago

I’m getting a”Error Establishing a Database Connection” error. How to fix?

Vivek
Vivek
1 year ago

Searched half the internet for a method to bypass carrier-grade NAT (CG-NAT) before finding your solution.

Although the auto-start causes occasional problems and doesn’t start.