Welcome reader.

Follow me on twitter here for similar projects; tweet me for any help with this one!


First please note: This instructable can be done within a day, but a weekend is certainly recommended.

In this instructable I hope to teach you key skills involved with setting up and configuring a Linux Server. The knowledge used here can be applied to almost all PC architectures so if you don't own a Pi (Why not dude?) or it's tied up in another project, any old or unused PC will work. In more detail the main skills taught will be:

  • Burning an ISO image to an SD for the Pi
  • Installing an OS
  • Setting up A web server
  • Setting up An SQL instance
  • Deploying a custom cloud network
  • Managing users for the cloud network
  • Setting up a SAMBA File sharing network, which will integrate into an established windows based home or office network
  • Controlling SAMBA users
  • Establishing a static IP whilst using a non-static IP internet connection
  • Using Webmin Console to install packages
  • Using Command line terminal to install packages
  • Carrying out basic commands such as rebooting (terminal)
  • Editing system files with Nano terminal based editor
  • Permanently mounting hard drives within the Linux file system table via webmin
  • Understanding the principal of the Port forwarding function on a home router
  • Setting up a web interfaced bit torrent manager
  • Being an overall IT nerd.

If you're interested then carry on reading. If not, give it a try; you may discover a new hobby.

As the above list demonstrates there's a lot to learn. I definitely feel this is a weekend project. I've followed this process several times and it takes a couple of days at least. Its good to take long breaks because your eyes may begin to become strained and you may suddenly become unenthusiastic about the whole thing. This instructable offers functions of many different store purchasable products, such as:

The server we'll setup will cost far less than each of these services in the long run and only a fraction of the cost of the combined services. Setting up your own server is not only custom and cheap, its very rewarding. I will be a happy guy if somebody benefits from what this instructable contains or become inspired by what I have done. It took ages to plan and write this instructable. If you learn anything at all or feel this instructable is well written or well documented, please vote for me in the Weekend Projects Contest or the I could make that contest.

I would also like to point out that this is not a comprehensive tutorial on designing a server case. There are details of my case on step 3, however this guide is intended to be a comprehensive software tutorial. So if you get stuck or feel a step isn't too clear, just let me know and i'll be happy to help.

A few tips: Because this takes more than one day, don't just fall asleep and forget what you were planing on doing next. Instead have a pile f post-it notes. This way before you ZzZzzzz... you can jot down anything that needs doing during the next session. I had loads. All over the walls, floors, chairs, desks - you name it! Okay slight exaggeration, but on a serious note they do help. I did use a full stack. Another tip would be to follow the steps on order. Don't just think "Hmm I like the sound of my own cloud network lets do that first!" The steps are in such an order that each before is most likely required for the current, if that makes sense. Just stick to the order, it'll make life easier. A final tip: don't be limited to what is taught here. Do Think of this as a base for inspiration. Adding more services such as those listed on the turnkey website is easily done using the search APT function within the Webmin Package manager.

Okay, Confused? Then let's learn...

Caution! This instructable contains 30 steps. Proceed at your own risk.

Step 1: Plan

First things first - Plan. There are many aspects involved with planning, and often when people over plan, they quickly lose interest in the actual task.

So, a brief plan is as follows.




        1 x Raspberry Pi  (B model)


        1 x External USB 2.5' HDD   (Capacity of your choice, mine is 1TB) 


         1 x Raspberry Pi Case of your choice   (Mine is a cheap £3 laser cut, clear acrylic, self assembly kit from )


  2 x Heat sinks for the processor on the Pi  (Mine were free with the case)


       1 x Ethernet Cable 


   1 x USB cable for the hard drive 


       1 x SD Card  (8GB or above strongly recommended. Also ensure you copy everything off the card as all data will be deleted.)


       Relevant power supplies for the Pi and HDD 





  We will be using the operating system image from  Ghoulmann.We'll download it later. The image is based on Raspian, which is a Debian flavor adapted for the Pi, that runs turnkey out the box.


Plan done. Proceed .

Is anyone else having a problem getting the OS image to boot on a Rpi3? I've done the process of making images multiple times with many OS, but this one will not boot.
<p>Had issues with the .img as well. Nothing happened when I powered up. Tried the instructions to turn Jessie into Turnkey as well. In the end found this guide that worked. Also fixed the network interfaces issue too.</p><p><a href="http://www.deosolutions.net/set-turnkey-linux-raspberry-pi-model-b/" rel="nofollow">http://www.deosolutions.net/set-turnkey-linux-rasp...</a><br><br>Now I am back here setting up services. :)</p>
<p>Here are instructions to make raspian jessie into turnkey:</p><p>https://www.instructables.com/id/Raspberry-PI-THE-HOME-SERVER-TURNKEY-LINUX/</p>
<p>thanks for this. The core.img refuses to boot, regardless of the config.txt settings. No safe mode, no nothinnnnn</p>
<p>I am. I even went in and edited the config.txt to my own script. Nothing will boot from the sd with this img on it. Ive configured the config settings countless different ways and it still does nothing. Im going into the .dat files to see if i can find anything</p>
<p>Good instructions </p><p>I'm new to a lot of this, Just wondering if a NAS could also be combined into this package. Also would a small cluster 3-5 PI3's improve performance of the home sever ?</p><p>Brad R. Betts</p>
<p>VERY well done. I have some friends planning their first foray into Raspberry Pi, and Linux in general as a result of this article.<br><br>I have a serious concern though: I would strongly encourage y'all to keep TLS/SSL *ON* -- especially if you plan to turn on port-forwarding on your routers (step 27), thereby exposing your server to the public internet -- and all that comes along with it (individual and state-sponsored hackers). Even the self-signed certificate, with the accompanying initial error prompt, is far better than having none at all (at least you're encrypted -- if not properly validated); and if you want a fully legitimate and validated TLS/SSL certificate, a basic one is NOT expensive -- unless you consider $9.99/year expensive (see NameCheap's Comodo PositiveSSL certificate) in which case I'd question what such a person is doing buying a Pi to begin with. Also, keep an eye on &quot;<a href="https://letsencrypt.org" rel="nofollow">https://letsencrypt.org&quot; </a> which aims to make TLS/SSL ubiquitous and free, automated, and open.<br><br>These instructibles are *great* but when it comes to technology -- especially internet-connected technology -- it's on YOU to educate yourselves instead of blindly following a set of instructions.<br><br>Have FUN... just keep your digital condom (TLS/SSL) on while doing it.</p>
<p>Like you I have concerns with respect to threats from outside of my personal network. can you explain exactly what you mean by keeping TLS/SSL on and exactly how to do that in the context of this exact project? Any help is much appreciated.</p>
<p>Step 6 I'm struggling with, I've tried several things. In the end I downloaded a different OS from here https://www.raspberrypi.org/downloads/raspbian/, which now works. How with this affect me with the other steps?</p>
<p>I have the same problem</p>
<p>Made it after a lot of struggling :D</p>
Just wondering, will a Pi be powerful enough to upload large files such as videos? I'm interested in making this for myself but I want something that I can use for storing large files, not just documents. Mainly wanting to build this as a NAS.
<p>Network transfer speed depends on multiple variables - Network Router Speed if you're using wireless - otherwise yout network switch speed, Server AND client Processor Speed, Ethernet Card Speed on both as well. All of which are lacking in power on an RPI for large file transfer. I'm using it for document hosting however</p>
<p>And storage device speed too which means either the speed of the SD card or the speed of the USB port on the RPI</p>
<p>Hello guys,</p><p>Im stuck at loging in to the samba server. The samba server is running ( i can see that in webmin). </p><p>- i &quot;map network drive&quot; on windows 10 with &quot;RPI_SERVER\sambashare&quot;</p><p>- i try to login with the pi user i added to samba via command line</p><p>And i keep getting the error, acces denied. </p><p>I don't have a homegroup of home network established. Is that the problem?</p><p>What am i doing wrong and how can i fix it?</p><p>Thanks in advance!</p>
<p>Concidering this project. One question though.<br>What is the likelihood of this working with a Pi Zero V1.3? </p>
<p>Forgot to mention - USE EXT4 format</p>
<p>Thought I'd add my experience with this build. If you're using a Mac to build the image then use SDFormatter the ApplePiBake.</p><p>Firstly, the image supplied here will only work with the original Pi 1. </p><p>Secondly, I didn't bother installing the MySQL or OwnCloud - all I wanted was a silent replacement for my noisy NAS drive. I may go back and do it at a later date.</p><p>The problems I ran in to were mainly with Transmission. Don't follow the instructions on this page as they don't work. If you have already installed it then as someone else posted :</p><p>Uninstall the package by running</p><p>apt-get remove transmission</p><p>Then, run</p><p>sudo apt-get install transmission-cli transmission-common transmission-daemon</p><p>When you edit the .json file make sure you change the cache-mem-buffer to 32 or 64. This was crashing the USB drive I had all the time and giving me an error of &quot;Read Only Drive&quot;. </p><p>Also, I had to change the permissions of debian-transmission to OWN the download folder otherwise you will get &quot;permission denied&quot;</p><p>I used chown debian-transmission:debian-transmission &lt;your download folder&gt; and it all works a treat!!</p><p>With the Samba share section I had to create a UNIX user first before running the script mentioned.</p><p>useradd -m &lt;your username&gt;</p><p>passwd &lt;your username&gt;</p><p>Hope this helps. It has taken me 4 attempts to get this up and running but the satisfaction in doing so is great!! Remember to back up the final image with ApplePiBake so if you do screw it up you can easily get it running again.</p>
<p>Is there an alternative OS? This one is 3+ years old and heavily outdated.</p>
<p>Okay I have been at this for two day, I changed the partition from ntfs to fat32 to eventually ext4 (so that permissions existed by default) but STILL can not get one cloud to work! it keeps telling me that :&quot;</p><p>Data directory (/media/serverhdd/cloud) not writable by ownCloud<br><br> <br> <br></p><p>Permissions can usually be fixed by giving the webserver write access to the ownCloud directory&quot;</p><p>For the love of God, please someone help me this is causing me to go insane</p>
<p>Hi, you have to change the permissions for the 'www-data' user, not 'root'.</p><p>If chown doesn't work (as mine didn't), change the '/etc/fstab' file to add the options to the automatic mout. I found good informations in here:</p><p><a href="http://www.linux.com/learn/tutorials/309527-understanding-linux-file-permissions" rel="nofollow">http://www.linux.com/learn/tutorials/309527-unders...</a></p><p><a href="http://askubuntu.com/questions/223016/setting-permission-for-ntfs-partition" rel="nofollow">http://askubuntu.com/questions/223016/setting-perm...</a></p><p>You can get the correct 'gid' and 'uid' typing 'id www-data' in the terminal</p><p>Mine is working properly now.</p><p>I hope it helps!</p><p><br></p>
<p>Could you please let us see your /etc/fstab line for the partition involving owncloud as an example? Thanks.</p>
<p>Hi, i am stuck at Step 6- Burning the image on the SD Card. My Problem is that Win32 doesnt find the Raspian Turnkey Image &amp; when i change the file format to .img, Win32 can find it and write the Image, but the root doesnt work... (I also tried downloading the image from Ghoulmann) <br><br>Any ideas?</p>
<p>Hi Timi6646,<br>I am also having a problem with this step. I can find and burn the image to a SD card but when I try to launch the OS from my PI, the red and green lights appear solid. An indication that the img didn't burn correctly. </p>
<p>Made this same mistake, then I realized that I never unpacked the img file.</p>
<p>You have to unpack the raspian img first. The final image size should be around 1.9gbs</p>
<p>Hey Timi6646</p><p>What model PI are you using? If your like me and using a model 2, the img file listed for this instructable is out of date I think. Check out this link: <a href="https://www.raspberrypi.org/forums/viewtopic.php?t=58151" rel="nofollow">https://www.raspberrypi.org/forums/viewtopic.php?t...</a> and more specific the following line and decide if it pertains to you: <br>&quot;For a Pi 2, this means your card has to have the latest NOOBS or Raspbian image, dating from the second week of February 2015 at the very earliest.&quot;<br></p>
<p>Hey, don't suppose anyone could point me to some help on how i would slightly change the setup of this server, i already have a static home IP address, so i didn't need to run no-ip, i also have my own domain id like to point this to, but each time i access the webpages (webmin.mydomain.co.uk, shellinabox.mydomain.co.uk,transmission.mydomain.co.uk or owncloud.mydomain.co.uk) it takes me to the apache homepage served by my raspberry pi instead of the actual tools? Iv set up port forwarding on my router but i either haven't set up the subdomains correctly (which i believe to be the case) but i cant figure out how to link the subdomains to the opened ports on my domain.... any ideas?</p>
<p>Will this work on a RPi 1 B+? I am having trouble with the booting of the OS. Do i have to use a different img?</p>
<p>when tryping the &quot;apt-get ntfs-3g&quot; I get this message:<br>E: Invalid operation ntfs-3g<br>any idea's? :-) thanks in advance</p>
<p>apt-get install ntfs-3g</p>
<p>recently I have been having a lot of issues getting a ntfs drive working with the new raspberry pi images, i opted to use ex fat format. If you have the ability to change formatting I would highly suggest it, it just seems to work much better</p>
<p>I have been having errors saying that I don't have enough disk space to update. I am using an 8GB SD card and I don't know whats wrong. Any ideas?</p>
<p>its a pretty quick and easy fix.<br>In your command line type </p><p>sudo raspi-config<br><br>expand filesystem should be the first choice follow the prompts and reboot the pi.</p><p>now try setting things up, everything should work now</p>
Does this work with the Raspberry Pi 3?
<p>i'm stuck on step 23 (creating a unix user for Samba with &quot;pdbedit -a -u *username here*&quot; it says &quot;Faild to add entry for user&quot; but untill here, everything works just fine.</p>
<p>I second this. Im curious</p>
<p>It should be, yes. As long as it's a SATA SSD it will behave the same as an HDD, with superior r/w speeds. Of course, you should use a SATA to USB converter, but a premade external SSD will be about the same.</p>
<p>Is it possible to use a SSD in place of the mechanical HD ??</p>
<p>After running without problems for a long time, suddenly Shellinabox doesnt recognize/accept my password anymore. Still can log in through Webmin so the password is ok.<br>When i make new user with a known password or even without a password, the problem still persistst. Anybody having any idea what is wrong?</p>
<p>Any chance you're using a '-' in your password? I've found my wireless keyboard/mouse combo will not respond to a '-' keystroke unless I use the right click and &quot;paste from browser&quot;. Since shell in a box doesn't show any hints about any password characters being entered it's easy to miss</p>
<p>no i didnt. was a password that always worked and suddenly no more. Yet i appreciate your input. Gosh, made me realize it is 2 years ago already</p>
<p>Same problem. Can anyone tell my why I can use my password in webmin or ssh but not in shell in a box?</p>
<p>I still haven't found an answer. I have just done a complete new install of raspbian and separately installed webmin, apache, php, mysql.<br>Shellinabox seems to be the only terminal available and will try to install that too once I found a decent source.<br>at least it brings webmin back to port 10000 as it is with my other linux systems</p>
<p>Perhaps it is the keyboard locale settings on the pi? I've run into that problem before, where everything seemed to type as I wanted it to, with the exception of a few of the special characters (@#$) and it was due to the keyboard locale settings. Just a thought.</p>
<p>thanks but i doubt it as all my other passwords still worked and the problem with shellinabox happened on all computers.<br>Thanks for yr suggestion though</p>
<p>What drive format would you recomend?<br></p>
<p>Don't use ntfs, it'll be shared as cifs so you'll get no benefit with other devices on the network. Use btrfs or ext4, they play nicer with *nix oses, and only the host will care what the fs is.</p>
Ntfs. So that you can imput files from mac and windows too
<p>I am stuck at Step 8: Shell Login. I have RPi 2 and followed <a href="https://www.instructables.com/member/jaxpr3394" rel="nofollow">jaxpr3394</a> instruction but neither port 4200 and 12320 does not work. I found that shellinabox service is not running, tried &quot;sudo service shellinabox start&quot; but still doesn't run. I confirm that using &quot;sudo service --status-all&quot;. </p>

About This Instructable




Bio: @theDillonWilson UK STEM Ambassador Certified Raspberry Pi Educator
More by DrWilson:Ultimate Raspberry Pi Home Server The Box Short Film Extreme Loft Conversion 
Add instructable to: