Introduction: Raspberry PI, THE SERVER (TURNKEY LINUX)

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:

Dedicated Amazon EC2 turnkey servers

Belkin routers that offer built in apps

Online cloud services such as Google Cloud

NAS servers such as this.

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...

what you need:
1-Raspberry Pi

2-SD card

3-Raspbian image file (Download from http://www.raspberrypi.org/downloads/ ONLY)

FIRST STAGE :
1-use this page to make your sd card bootable

2-insert your sd card and turn on your PI

3-wait until you see the "raspi-config" menu

4-expand your sd card

5-set your locale ,Timezone ....

6-(IMPORTANT) in the "ADVANCE" menu, set your gpu ram to 16mb

7-(IMPORTANT) in the "ADVANCE" menu, Enable ssh

8-finish. your pi will now restart.

now you have a HEADLESS PI. it means you don't need your keyboard or monitor anymore

just connect your pi to a router

we will use SSH to continue our work

SECOND STAGE :
1-find your PI ip address.

2-in Linux or Mac open the termianl and run this command:
$ ssh pi@"YOUR_PI_IP"

3-enter the default password "raspberry"
4-set your ROOT password:
$ sudo passwd root

5-logout of pi:
$ logout
6-login to root:

$ ssh root@"YOUR_PI_IP"

your Raspbian is ready now. we will use TKL_PATCH to turn the Raspbain into TurnkeyLinux.
Thanks to ghoulmann & Mort'z

THIRD STAGE :

(just copy and paste to your terminal)

1- ssh to root

$ ssh root@"YOUR_PI_IP"

2-clone git repo to your PI:
$ git clone https://github.com/mortezaPRK/Raspliance-Core /tmp/tkl

3-go to /tmp and compile tkl patch:
$ cd /tmp/tkl/

$ ./compile_tklpatch.sh

4-install TurnKey into system path:
$ tklpatch-apply / ./core/

wait until everything finish. you should restart your pi:
$ shutdown -r now

or

$ reboot

now connect your keyboard and monitor to PI again

in first boot, you should enter root password

remember to choose the most powerful password you can.

ITS DONE
you can use this instructables for more information about TURNKEY....

Most common problems and their Solutions :
you may encounter some problems during or after installation.

1-you get session closed when using shell in box?
Solution: use ssh then "enter the "nano /etc/hosts" menu and change 127.0.1.1 from "core" to "mynewname""

2-# UNCONFIGURED INTERFACES?
Solution 1: quit the confconsole. login to root. edit file "interfaces" on /etc/networkk

add following line to top of the file:

# UNCONFIGURED INTERFACES

(or run this command: $ sed -i '1i# UNCONFIGURED INTERFACES' /etc/network/interfaces)

Solution 2: (ONLY if fix one doesn't work for you)
quit confconsole .login to root:

$ /etc/init.d/confconsole stop
$ update-rc.d -f confconsole remove

Comments

author
vr00m (author)2015-08-08

The compilation went without a hitch. Then the problems started.

"tklpatch-apply / ./core/" gets a lot of things done, but then exits with:

+ sed -i '1i# UNCONFIGURED INTERFACES' /etc/network/interfaces
sed: can't read /etc/network/interfaces: No such file or directory

I
manually edited the file to put the intended text ("# UNCONFIGURED
INTERFACES"), and tried to run the scripts manually. But after running
the scripts, when I restart, I'm locked out of my rpi2 with "ssh
connection refused". I don't have a monitor to connect to my rpi2, so
I'm doing this purely over ssh.

If anyone has succeeded to any extent, then please leave a comment detailing your method.

author
oss001 (author)vr00m2017-02-11

This does still work. Try this here if you are having the interfaces problem. Guides you through what to do.

http://www.deosolutions.net/set-turnkey-linux-rasp...

Worked for me on my Raspberry Pi B, now I am working on setting it up as the ultimate server. :)

author
David WE (author)vr00m2015-08-10

I suspect this and the instructable that was built from this (and which a comment sent me here to try to load the dang stuff) just don't work anymore. Why? Don't know as I haven't tried to tear into the tklpatch-apply yet. I do know that I can load Raspian to all 3 of the Pi's I'm using for testing this (a model B, a model B+ and a Pi 2 model B). I can do the git clone and the compilation. But the tklpatch-apply? Nope - I get aborts just as you do at the same point and same message. Considering how old this and the other instructable are, I'm not betting on ever getting this to work. If you, or someone else current, gets this installed please post the instructions back here.

author
clintcoats (author)2016-08-07

I have installed per the directions above on a pi 3 model b. Now I can only ssh into the pi. When I boot up the pi I only get a blank screen on the pi itself, but I can ssh in from another laptop. Any thoughts would be greatly appreciated.

author
Voorbips (author)2016-05-25

Hello guys,

I'm using putty to ssh into my pi, it works if i use the pi user but i keep getting the error that acces is denies or permission denied if i try to login to root user even though i use the same password i set it to for root user.

Can anybody help me?

author
bob0420 (author)Voorbips2016-07-10

You have to use raspbian wheezy not jessie to get this to work.

author
SencerY (author)2015-11-01

I did it, but the question is , how do I turn it back? well I tried this on a raspberry , and now I need to do this to an other raspberry , and turn this one back.Thanks, was a wonderful tutorial...

author
AndyT5 (author)2015-06-02

How do I get to the turnkey logon screen when I cannot access Pi with the internet address

author
MikeS44 (author)AndyT52015-06-02

With AndyT5. Followed instructions, everything went well, cannot access turnkey login through x.x.x.x:12321 I'm getting a connection refused error.

author
jfherring (author)MikeS442015-08-14

Me too. Ever get it figured out? I see no input from the author, I hope you can offer something.

author
MikeS44 (author)jfherring2015-08-14

I became sidetracked (but have wanted to Complete this Project. I'll let you know. I've become a bit better at linux since then So fingers Crossed.

author
jfherring (author)MikeS442015-08-14

I just got it. Webmin wasn't running by default. If you hit

<your_ip>:4200

you can log in via shell. After logged in, start webmin with

service webmin start

thin you can login to webmin by going to

<your_ip>:12321

After logging in there, click the UPDATE button at the bottom, let it do it's thing. After it updates, there will be a checkbox to have it auto start on boot up from there on out. Good luck!

author
cslatton (author)jfherring2015-10-06

Thanks, this was extremely useful and saved me a headache!

author
MikeS44 (author)jfherring2015-08-15

Well hello smarty pants! Thanks for the help. I appreciate it.

author
ChristoO1 (author)2015-04-06

I'm going to try this as a test run. thank you.

Do you know about this one.

https://www.instructables.com/id/Ultimate-Pi-Based-...

author
MortezaP (author)ChristoO12015-04-06

I mentioned this page at the end of my instructable :)

author
David WE (author)MortezaP2015-08-14

MortezaP - since many of us are encountering the problem with network interfaces, can you lay out step-by-step instructions on how to overcome this? Obviously just creating the file doesn't work - I tried that and when you restart the patch it complains about existing directories. So, some help on restarting the patch process after creating this file - such as cleaning up any existing directories or perhaps entering a restart point for the script (I assume one could jump into a specific point since some things are already done at the point of this abort).

ANY help on this would be greatly appreciated! Also - with the script and patch work with the newest Raspian on any Pi (Pi model B, Pi model B+ or Pi 2) ?

Thanks!

author
Somnambulator! (author)2015-05-07

Has Turnkey really not been updated in 2.5 years? Is this still the best distro to achieve all this considering the B+ and 2 werent even thought up at that time?

author
AdamN4 (author)2015-01-05

This was a life saver!! Thank you so much for sharing this.

author
seamster (author)2014-10-15

Nicely done. Thanks for sharing this!