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 ebay)


  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 .

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>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>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>
<p>So, I have a media drive. My media center dies and I want to take the disk to my Windows machine. Easiest if ntfs. However, in Linux there are no &quot;permissions&quot; associated with an ntfs file system. So, it's a give and take.</p>
<p>Problem: Pi hanging during every installation attempt</p><p>Info: using 32GB, Class 10 full size SD card</p><p>Action: Re-formatted, Re-imaged, Re-installed image multiple times. Also memory tested and passed SD card.</p><p>Real Problem: Power voltage at Pi Board (requirement of 4.75VDC to 5.25VDC across test points T1 &amp; T2 on Pi board).</p><p>New Action: replaced 6 foot USB cable with 4 inch USB cable, problem completely went away, and install continued without a hitch (until I ran into the network configuration problem mentioned in other posts).</p><p>Conclusion: If Pi is acting flaky, test voltage at board test points.</p>
<p>Well, some success so that at least I can move on to the next step beyond webmin. For those interested:</p><p>- used a Pi model B (not B+ but it should work; Pi 2 won't work with this image)</p><p>- booted once and eventually got the turnkey Linux configuration console </p><p>- tried advance menu/automatically configure network but got some kind of error</p><p>- in the advance menu chose quit - this exited me to the shell</p><p>- tried nano of /etc/interfaces and added the appropriate line as per this how-to</p><p>- exited nano after saving the file then did chmod 766 interfaces</p><p>- typed reboot and pressed enter so the Pi would reboot</p><p>- got the rasp-config this time on boot instead of the turnkey Linux configuration console. Selected expand the filesystem. Set my keyboard/locale/time zone accordingly. The went to advanced and did the following: set memory split to 16 for the gpu; enable ssh,</p><p>- selected reboot. The reboot took a LONG time for me because at reboot is when it actually expanded the file system on my SD card - and I'm using a 64gb SD card as it is what I had quickly available without hunting through the &quot;junk drawer&quot;.</p><p>- got the turnkey Linux configuration console again</p><p>- on my PC, did https (http didn't work) to the webmin address. Here's a hint: while testing, leave your monitor plugged in to the HDMI port on the Pi - you'll be able to tell if networking is set up, what the shell, webmin and ssh/sftp addresses are.</p><p>- the above actually got me to the webmin screen and I was able to proceed with it's instructions.</p><p>I'm off now to move on to the next step. I wanted to post this now in case it *might* be of any help to anyone - I don't know if it will or not.</p>
<p>Using a USB hub? It always needs to be a self-powered hub with the Pi. The Pi's don't provide enough current for any hub, especially one with devices plugged in (like keyboards, mice, wireless adapters for keyboards/mice, wireless network adapters, disk drives, etc.). Don't know if this was your problem as you never mentioned a hub, but curious what the USB cable was connecting to. You may also have had a bad USB cable - I've run into this before and all kinds of strange symptoms result.</p><p>BTW - are you using a Pi model B, a Pi model B+ or a Pi 2? It seems to make a difference. I doubt it would work with a Pi 2 as the image seems to be pre-Pi 2 and I know they made some sort of changes to accommodate the Pi 2. The model B+ I tested didn't work either, but just a Pi model B did.</p><p>If any of us find a way around this network configuration problem can you let us all know the steps you took? Has anyone tried this with the network adapter connection plugged in? Did it work then?</p><p>I have also found MANY threads on the net for building a home server with a Pi that can be used for model B, model B+ and Pi 2's with no problems. These don't seem to include all the things this image is supposed to, but I imagine they can be added via apt-get. For just file sharing and backups all of the products in this image aren't needed - just add samba to a normal installation. </p><p>I may try just following the instructions at turnkey itself and see if I can make something happen. Considering I'd like to learn about servers in general, I'd like to get these extra products included so I can learn them as well.</p>
<p>I got through it. I built from scratch on Raspbian 20150505 w/updates, with a boot to external usb HDD (moved the / folder to the usb HDD) and with a fixed IP wifi network connection. Connections via tightvnc, ssh (pgp key) and webmin for general maintenance, and the ownCloud page for it's maintenance. <br>I had to change the owner of the cloud folder to www-data and permissions to 770 to get it to work. YMMV, but it can be done.</p>
<p>Could you by chance post your steps to get this done? I know myself and others trying this could really use the help to get this set up.</p><p>Thanks!!</p>
<p>I'll have some free time this weekend. I didn't do ALL the server services that the listed image was supposed to have, but it was more than the simple LAMP server. I found some good instructions that give you boot to external drive (USB Flash, USB HDD, etc), which gives me 240GB (self powered external HD) that will survive lots better than an SD card. I've burned out maybe 20 various SD cards using them for things like XBMC, DLNA servers, etc. </p>
<p>Has anyone actually had this work? I've been trying this for 3 days and no matter what Pi model I try or how many times I burn the img file to SD I cannot get this to boot. Sometimes nothing happens, other times I get a strangely colored screen, but either way nothing happens no longer how long I wait.</p>
<p>I agree the image is corrupted ....it will never boot....not sure even if it was a good image it would work for a raspi2</p>
<p>won't work on a pi 2 - the small difference in architecture was after the image was created, as best as I can tell. I eventually did get this to boot on an original Pi model B but can't get around the setups' section on the network - it doesn't appear to be &quot;simple answers&quot; as stated. I may try to follow the turnkey Linux pages to see if I can build this from a current Raspian image that would work on a Pi 2. My problem is that I don't know what the heck all of this is to begin with - I just want to build a small server to try to learn with.</p>
<p>How long will it take for the setup scripts to appear? Did I do something wrong? Mine aren't appearing :(</p>

About This Instructable


3,383 favorites


Bio: Student, Manchester UK. Usually I'm making things - electronics, computer programming, woodwork, DIY and construction. Follow me for awesome stuff.
More by DrWilson: Ultimate Pi Home Server The Box Short Film Extreme Loft Conversion
Add instructable to: