Introduction: How to Use Raspberry Pi As a Server
The main reason behind the incredible popularity of Raspberry Pi is its usefulness. The small computer can be used for a number of fun projects that not only satisfy certain needs but also are fantastic educational tools for people of all ages. One of the most popular things to do with the Pi is to turn it into a capable home server. Such server can host a website, give you an easy access to your music and video files, or let you share a printer between different computers. The whole thing can be finished in less than a day for a very low cost.
Why Raspberry Pi?
The price of the Raspberry Pi 2 B or B+ is hard to beat. For around $30, you get to enjoy the best raspberry pi 3 starter kit with built in WiFi, Bluetooth, fast Ethernet connection, full-sized USB ports, HDMI output, and a handful of GPIO pins that greatly extend the scope of what can be accomplished with this device.
What’s more, the unit consumes only a very little power and produces absolutely no noise at all. You won’t have to worry about your electricity bill skyrocketing or problems falling asleep due to high fan noise.
Finally, we cannot forget to mention the fantastic community of enthusiastic users. Pi owners are always very keen to share their projects and inventions with others, and you will never have a problem getting great answers to your questions.
What You’ll Need
Besides the Pi itself, you will also need a class 10 SD card for an operating system, 5V/2A power supply (a quality micro-USB smartphone charger is a great option), and a way to interact with the Pi. You can either plug in mouse, keyboard, and a monitor or use SSH for remote control.
Optionally, it’s not a bad idea to put the Raspberry Pi into a case to prevent any damage from occurring, and you can also think about buying an external hard drive to host all your media files.
Step 1: Install an Operating System
The first thing to do is to install an operating system. Beginners are encouraged to use NOOBS, which is a handy utility that will one of several operating systems for you.
Head over to the Downloads page and download the appropriate file. Simply copy the content of the file to your SD card, insert it into the Raspberry Pi, and follow the instructions. We strongly recommend you to install Raspbian. It’s well optimized, easy-to-use, and compatible with most tutorials out there.
Step 2: Configure Internet Access
The simplest way how to connect to the Internet is using a wired network. Just plug an Ethernet cable leading from a router to your Pi and you are good to go.
Of course, this may not be the most practical solution. To connect via Wi-Fi, you need to purchase a compatible adapter and connect to your home network. But using the raspberry pi 3, there is no need of any wifi adapter.
Step 3: Install Apache and Change the Default Page
Apache is the world's most used web server software and installing apache on your Pi takes just a few minutes. All you need to do is follow the official instructions.
By default, Apache will display the content of a HTML file located at /var/www/html/index.html. You can edit this file directly, but it may be more convenient to change its location to, for example, your home folder. Once again, the official tutorial has you covered.
11 Comments
6 years ago
There are 2 main disadvantages:
1. RPi has only 100Mbit LAN
2. RPi has no SATA port, only USB2 is available
so it works but is way too slow for NAS
Reply 1 year ago
So use an R Pi 400.
Reply 1 year ago
4 yrs ago it wasn't available :)
anyway, still no SATA onboard :(.
7 years ago
Where can I buy a case like the one in the main image for the article? I've already built an RPi2 based server running a custom build of Raspbian-Lite, and would love to pair it up with a case that would allow for installing a harddrive.
Reply 5 years ago
Hi, finally you know wher can you buy a case like the one in the main image for the article?
I´m so interesting on that.
Thank you
Reply 5 years ago
No one answered my question --so, the answer is no. The post itself was made 2 years ago. You might have better luck with a search on Amazon or Google. But I'm generally too busy to bother with it. Besides, an RPi3 as a NAS isn't really fast enough to be useful to me.
Reply 2 years ago
If you look carefully at the case that you are referring to, it has a Modem port which leads me to believe that the author of this article found the case and "repurpose" it.
It may have been from an old router or something like that.
3 years ago
The name of the post is misleading, it should be "HOW TO USE RPI AS A WEB SERVER"
The WEB part is missing in the name, that is why people think that is incomplete.
6 years ago
Awesome project. Would recommend to anyone. For the nay-sayers: it's not only complete but, like she said, you can connect to it via SSH. If this is too complicated for you, then before you put the RPi in a case plug in a mouse, keyboard and monitor, make sure you have an internet connection to the RPi, open a terminal and type: "apt-get install xrdp". Then you can manage it via a remote windows desktop session.
7 years ago
i like it...but it doesn't seem complete
7 years ago
Is this complete? I would like to use this!