Welcome reader.

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>What drive format would you recomend?<br></p>
<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>you can go <a href="http://www.aakeys.com" rel="nofollow"> www.aakeys.com </a> to get good windows, it is genuine and cheap</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>
<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 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>
<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>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>just a general tip.<br>using the dns name of the raspberry (or any other computer) in your browser to go to a webpage on the raspberry or to go to webmin or shellinabox, such as e.g.<br><a href="http://raspberrypi:12321" rel="nofollow">http://raspberrypi:12321 </a> doesnt always work and your browser may insist that actually you mean &quot;www.raspberrypi.com:12321&quot;. Having to use the internal 192.168.x.yyy address is a a drag<br>However if you do &quot;raspberrypi.local:12321&quot; it always seems to work</p>
<p>This will only work if you are running Mac or Linux, or if you are running Windoze and have iTunes installed. (Apple wrote their own mDNS client for the Windoze version of iTunes (which they call Bonjour), which gets installed when you install iTunes.) Also, you might need to add .local to the end of the address depending on how your router is set up, like http://raspberrypi.local:12321.</p>
<p>yes http://raspberrypi.local:12321 is what i suggested. It works on my windows and I do not have iTunes</p>
<p>What browser and Windows version are you using, and have you ever had any Apple software installed? Also, using Ubuntu and Chromium, for me http://raspberrypi:12321 NEVER works, even if I make sure to go to that actual address. It always gives &quot;DNS_PROBE_FINISHED_NXDOMAIN&quot;. The only way that could possibly work is if your router's configured in a specific way.</p>
<p>windows 10 using chrome, edge IE and firefox.<br>Ubuntu12.04 with firefox<br>Did never get the error you mentioned.<br>did not configure my router in any specific way<br>never downloaded Apple softwar</p>
<p>Hey guys, I have a quick question about ownCloud. Downloading and installing it shows version 4.0.4 in the ownCloud dashboard and running an apt-get update and apt-get upgrade does not detect anything newer, but version 8 is currently out. Can anyone shed any light on how to go about upgrading from 4.0.4? I would prefer not to have to start over with it and would gladly upgrade step by step until I get to the latest version if that is what it takes.</p>
<p>Disregard, I was having a moment. I just went to their Web site and found the answer that I was looking for by using the oBS method mentioned. For anyone else that is going to do that - when I first did it, it gave me a 404 error when trying to access /owncloud. To fix it, I just ran the sudo apt-get purge owncloud command, which removed (I am assuming) some of the files of the second installation that resulted from the oBS method. When I did this, it was up and running with the newest version. Strange and I know I could understand it better if I put the time into the research, but I haven't had a chance to as of yet, but I just wanted to let anyone else know that was curious about upgrading from 4.0.4 to 8.1.1. :)</p>
<p>hey drwilson i'm done with it thanks for the steps and the idea this is mine project</p>
<p>This step didn't work for me initially, but once I set &quot;rpc-whitelist-enabled&quot; to false it worked perfectly.</p>
<p>Thanks for the info!</p>
<p>Hey. I'm kinda having a problem with </p><p>/etc/init.d/transmission-daemon stop</p><p>All I get is</p><p>-bash: /etc/init.d/transmission-daemon: No such file or directory </p><p>and when I try to access </p><p>nano /etc/transmission-daemon/settings.json</p><p>It's just blank </p><p>Can someone please enlighten me :) </p>
<p>Ran into the same problem, Elliot. 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>That should do the trick. If not, let me know!</p>
<p>Thanks man!</p>
<p>Yeah it worked. Thank you so much Garrett :) </p>
<p>Not a problem, Elliot!</p>
Thanks man I'll give that a try and let you know ?
<p>I had some &quot;failed to mout bla bla bla&quot;... error<br>The solution was found in:<br>https://www.raspberrypi.org/forums/viewtopic.php?t=74776&amp;p=536000</p>
<p> i've been looking for a good server set up for the raspberry pi for a while now and I really like the looks of this one! Made it to step eight no problem but now when I try to start the Shell from a browser I can't connect to it. I can connect to Webmin just fine in the browser but not to the Shell. Any help would be appreciated. </p>
<p>Well, there were a couple stumbles along the way, and an important item or 2 left out, but I've gotten it working now. Thank you so much!</p>
<p>the monitor cannot detect i</p>
Can you make a tutorial on how to make a box for it?!
Very good
<p>Instead of going through the trouble of mounting it with ntfs-3g, why don't you format the drive to ext4? After all, SAMBA handles the sharing of files with your Windows computers, so they don't require it to be a Windows-compatible format. Unless you want to have the ability to plug the drives into a Windows computer as well.</p>

About This Instructable


3,468 favorites


Bio: Student. Usually I'm making things - electronics, computer programming, woodwork, DIY and all things awesome.!
More by DrWilson: Ultimate Raspberry Pi Home Server The Box Short Film Extreme Loft Conversion
Add instructable to: