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 .

<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>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>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>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>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="http://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>
<p>Had the same problem, just managed to get through with this tutorial: </p><p><a href="http://blog.remibergsma.com/2013/03/15/always-available-linux-terminal-shell-in-a-box-on-raspberry-pi/" rel="nofollow">http://blog.remibergsma.com/2013/03/15/always-avai...</a></p><p>I am not sure what exactly solved this problem, new installation, update or just reboot of the shellinabox's daemon. Here are the steps I took through ssh:</p><p>sudo apt-get shellinabox install</p><p>sudo apt-get shellinabox update</p><p>After I did the reboot of daemon with: </p><p>sudo /etc/init.d/shellinabox restart</p><p>What can also be done this way:</p><ol><br><li>sudo /etc/init.d/shellinabox stop<li>sudo /etc/init.d/shellinabox start</ol><p>And finally use:</p><p> /etc/init.d/shellinabox status</p><p>You expect to see something like &quot;Shellinabox daemon is running&quot;. After that I had sucessful connection through 192.168.1.x:4200</p><p>Hope it helps!</p><p>P.S. You can also check your ports with </p><p>netstat -ntl </p><p>but this should not be an issue, as Raspbian comes without any firewall restrictions. Good luck!</p>
<p>The order is wrong in first two commands, rest is ok, those two should look like: </p><p>sudo apt-get install shellinabox</p><p>sudo apt-get update shellinabox</p>
<p>Hey guys, signed up here to be able to comment and hopefully help people out. I just followed this guide and am up and running smooth now, but it involved pulling information from a lot of various resources. So, first and foremost, I don't take credit for all of this. Some helpful information I found while digging through everyone one of these comments, and some I found through hours of consulting Google.</p><p>For everyone's information, I am running a Raspberry Pi 2.</p><p>To start, getting the image on the SD card, I followed this:<br><a href="http://www.instructables.com/id/Raspberry-PI-THE-HOME-SERVER-TURNKEY-LINUX/" rel="nofollow">http://www.instructables.com/id/Raspberry-PI-THE-H...<br></a>Which has a link to download the Raspbian image itself from the official site. To write the image to the SD card, however, I used the image writing software mentioned in this guide, then continued with the instructions in the link above to get it running Turnkey Linux. You will get the # UNCONFIGURED INTERFACES error mentioned at the bottom of the guide on the above link. To fix it, I read online about how to make an interfaces file for Linux. Mine is as follows:</p><p># UNCONFIGURED INTERFACES</p><p>auto lo</p><p>iface lo inet loopback</p><p>auto eth0</p><p>iface eth0 inet static</p><p> address 192.168.x.x</p><p> netmask</p><p> gateway 192.168.x.x</p><p>Then I reran the tklpatch-apply / ./core/ command that generated this error and all went well.</p><p>Then, I came back to this guide and picked up on step 7, which is updating Webmin. By default, Webmin is not set to start on boot, which means you have to run sudo service webmin start to get it up and running, so you can access on port 12321 (192.168.x.x:12321).</p><p>In regards to shellinabox, the default port is 4200, not 12320 (at least for the Turnkey image that we loaded onto our SD card with the instructions I mentioned above)</p><p>Everything else went well, actually. I am loving the functionality of my Pi. If anyone is interested, you can also set up a VPN, which is pretty nifty itself. The guide I followed to do this is:<br><a href="http://readwrite.com/2014/04/10/raspberry-pi-vpn-tutorial-server-secure-web-browsing" rel="nofollow">http://readwrite.com/2014/04/10/raspberry-pi-vpn-t...<br></a>I use it to encrypt my sensitive internet traffic as well as to access my home network's shared drive that contains data that I do not want accessible via the internet.</p><p>I hope this was able to help some of you! I saw some of the more recent comments, so it motivated me to write this.</p>
<p>Thanks buddy! I had exactly the same challenge and your respond help me. </p>
<p>Thanks jaxpr3394. I could not get the image given in this post written on my card. Then I followed your comment. And it was a breeze. However, I faced problem at the &quot;Updating webmin&quot; step. There was warning that &quot;the program <a href="" rel="nofollow"></a> was linked to from an unknown URL, which appears to be outside the Webmin server.&quot; Even editing from the config module gave the same message. What I did was,</p><p>&gt; edit the /etc/webmin/config file with &quot;vi /etc/webmin/config&quot; command.<br>&gt; Find the line referers_none=1 and change it to referers_none=0.<br>&gt; Save the file and restart webmin.</p><p>(for new linux users, this is how you edit files in command line: https://www.howtoforge.com/faq/how-to-edit-files-on-the-command-line)</p>
<p>THANK YOU!!! I've got to try this with a Pi 2 that I have for testing but which of course wouldn't run the pre-built image.</p>
<p>You are some kind of saint. I just started this project today and had to follow your instructions here to get things running. Muchly appreciated.</p>
<p>Great! I am glad I could help someone else and save from the headaches I faced. Thank you again for the creator of the guide itself as well as all of the resources I pulled from!</p><p>Enjoy.</p>
<p>I forgot to mention, you can also enable SSL following this guide:</p><p><a href="https://hallard.me/enable-ssl-for-apache-server-in-5-minutes/" rel="nofollow">https://hallard.me/enable-ssl-for-apache-server-in...</a></p><p>Also, I just realized that you could format your text in these comments, I apologize for the poor formatting of my previous post.</p>
Can I use a wifi dongle instead of Ethernet?
<p>Could I use a RPi 2 instead of a model B? Thanks for the answers</p>
<p>Could I use a RPi 2 instead of a model B? Thanks for the answers</p>
<p>Hi, New owner of a RPI v2. and using MacOS. Trying to follow the instructions &quot;This will allow us to burn an operating system image to our SD card.</p><ul><br><li>Next download the ISO of the Raspian Turnkey mix from <a href="https://github.com/downloads/ghoulmann/Raspliance-Core/raspliance-core-02.img.tar.gz" rel="nofollow">here</a>. <tt>Credit to </tt><tt><a href="http://gonzotech.tumblr.com/post/35816630624/server-core-for-raspberry-pi" rel="nofollow">Ghoulmann</a> for the image.&quot;</tt></ul><p>Used dd command to burn to new mico sdd. sudo dd bs=2m if=/Users/robbab2/Downloads/Installers/RPI/raspliance-core-02.img of=/dev/rdisk3</p><p>it creates two partitions: one &quot;untitled&quot; and one &quot;disk3s2&quot; Looks like untitled is MS-FAT 16 and disk3c2 is linux. Whats up and PI can't read?</p><p>Thank you for your Answer.</p><p>wc</p>
<p>Am i able to run this server alongside my existing vpn server on the same raspberry pi?</p>
<p>Any one with issues to access OwnCloud due to permissions, here's the code I had to use. (Using HDD formatted to ext4)</p><p>sudo chmod 770 /media/serverhdd/cloud</p><p>chown www-data:www-data /media/serverhdd/cloud</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>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>One of the best articles I ever seen on internet. Congratulations ... sorry my english.</p>
<p>I'm confused on the Users comment about needing a unix account to match for samba. Where am i creating these accounts? I've got 5 people in the house that will be accesing this.</p>
You forgot to mention to unpack the tar.gz file. <br>After downloading type: <br>tar xzf noip-duc-linux.tar.gz <br> <br>After this you can continue with the tutorial. <br>

About This Instructable