loading

Hi, and welcome to my instructable!

here I'm gonna show you how to set up your Raspberry Pi to function as a Cloud, you know? Just like Dropbox!

first, lets add a short MoSCoW list:

Must have:

One thing this PiCloud must definitely have is a good accessibility, you should be able to acces it from every computer in the house.

Should have:

What this PiCloud should have is a good case to keep it away from dust and protect it.

Could have:

What the PiCloud could have is accessibility from the net, with this I mean the possibility to acces it from any PC, anywhere.

Wont have:

The function this PiCloud wont have is HUGE storage space, I mean, it's a private server/cloud, why would I want thousands and thousands Gb's?

Now that we've got that list done, lets start with the next, here is all the stuff you're gonna need:

  • ABS (you know, the stuff that goes into the 3D printers).
  • Triplex (you know, the stuff that goes into the laser cutter).
  • Raspberry Pi (in this instructable I'll be using the Pi model B, but any model will do fine).
  • A power adapter for the Pi (any phone adapter will work).
  • A SD card for your Pi to boot on.
  • A monitor (Not for the whole project, just to set some things up).
  • A keyboard (Same story as the monitor).
  • A mouse (Same story as the monitor and keyboard).
  • An Ethernet cable.
  • An USB stick or External HDD.
  • A laptop, for installation purposes.

We've now got two solid lists of what we want and what we need. let's add the third list, and then we're almost done for this step.

Tools needed:

  • A Lasercutter, usually found in a fablab.
  • A 3D Printer, usually found in a fablab.
  • A Dremel tool.

"Yo dawg, I heard you like reading lists, so Imma put a list in your list so you can read lists while you read lists."

In this last list I'd like to put some links to instructables, sites, etc. which I used to create this server.

So, that's it for the lists, let's proceed to step 1.

Step 1: 3D Printing the Case.

Sure, it's all possible to buy a case, it saves lot's of work and time, but you know, they cost money....

So, Let's 3D print a case! This takes a bit longer, but it sure does save you a lot of money.

All you need to do is make or find a template for your model Pi and load it up in a 3D-printer. whenever it's loaded just hit the "print" button and you're set!

I also added two hinges to the case for easy access purposes. I Simply printed them, and then I superglued them in place. After glueing them I found out they were a bit to long, so I used a Dremel to cut off the sharp long edges.

For my model I used the template: Raspberry Pi (Model B) case.

And for the hinges I used: Lift Off Hinge.

Thingiverse is a great site, it's got templates of anything you need 3D-print.

of course it's possible to use another template, or even design your own. but for this project I decided to use this template.

after the printing proces is done, make sure your case is solid and maybe sand it up a bit to smoothen it out.

everything fits and looks okay? Nice! lets proceed to step 2.

Step 2: Lasercutting!

Wow, that sounds spectacular! LASERS!

sorry to let you down, but in fact it's not that interesting, it looks awesome, but it's nothing more than clicking print and you're done.

First I designed the things I need in Adobe illustrator, the parts i needed aren't that hard to design, but it's hard to find a template online, so I went on and made the whole thing myself. What I basically wanted was a rectangular board to mount the case on and than mount that board to the wall. To make it a bit more interesting I decided to add my initials "JvH". I Also added two holes for screws to go through.

You can see my design in the pictures.

As I mentioned before, the designing isn't hard, just make sure the lines are the right color and have the appropriate thickness. After you've got the designing part done, its as easy as 3D Printing, just load it up and click the "print" button.

Lasercutting done? Well done! let's proceed to step 3.

Step 3: Raspbian OS.

Okay, now for the hard stuff.

From now on all we're gonna do is computer magic, programming, installing etc.

First, as mentioned in the title of this step, we're gonna install the OS on the Raspberry Pi.

insert your SD card in your PC and make sure it's formatted in FAT32. then download and install Raspbian on it.

Since there are many many tutorials on how to install Raspbian i'm not going to explain it here, but I will give you the link: Installing OS images.

When you're done installing put your SD card in the Pi and plug it in a power outlet, make sure the red PWR led is on and the green ACT led is blinking/on.

Okay, now your Pi should have an OS on it to work with, let's proceed.

Step 4: Setting Up Turnkey Linux.

Now that you've got Raspbian running it's time to set up Turnkey, which enables lots of server utilities.

Plug in your monitor, mouse, keyboard, SD card and last, your power adapter.

The Pi should now boot like magic and BOOM, there is your OS.

First you'll wanna go to the preferences menu and adjust the next few things (YES, LIST INCOMING):

  • Set your timezone.
  • Set GPU memory to 16.
  • Enable SSH.
  • Set a password.
  • Boot to CLI on startup.

After you've done that shutdown the Pi and disconnect everything but the SD.

Now your Pi is what they call "Headless", you can acces it without a keyboard, mouse or monitor.

So let's move on and plug your Pi into your router and power it on.

Next up, we're going to ssh to your Pi and install Turnkey.

On my macbook, I opened terminal and typed:

ssh pi@"IP-adress"

At the "IP-adress" I entered the Ip adress of my Pi.

This should result in a line asking for your password, fill that one in, and Boom! you're in.

Now we'll need root acces, to do that, type:

Sudo passwd

You'll get asked for a UNIX password, make sure it's a good one!

After that you'll need to logout and ssh into the root account, this is done by:

ssh root@"IP-adress"

Now that you should be logged into the root account, let's setup the Turnkey download and installation. It's quite simple, just copy and paste the following commands one by one (YAY! A LIST):

When that's done you've successfully completed step 4! let's proceed.

Step 5: Webmin.

Okay, first a bit of explanation, Webmin is the service to host all of your tools on. It makes sure you'll be able to manage and install stuff like MySQL, OwnCloud, PHP, etc.

To make use of Webmin you'll need to start the service, SSH into your root account and type service webmin start.

Now you can logout and open your web browser. go to "IP-adress":12321. This is the port for Webmin, you should see a login screen. Login with your root account and password.

On the bottom of you're screen there should be something like "Update webmin", hit that link and let it run for a bit.

Whenever it's done, SSH into your root or pi account and reboot the Pi.

Well done! Webmin should now be updated and running! Let's proceed.

Step 6: Storage Space.

Let's add some storage space to our cloud, to do so, shutdown the Pi, add plug in your USB or External HDD and restart it.

Make sure your USB is formated in FAT32 before you're plugging it in.

When your Pi has restarted, head to Webmin (Remember? "IP-adress":12321) and under the tab system click "Disks and Network Filesystems".

In the empty bar type: /media/"Your Drive name", Select the dot "Disk", there should be only one option in the menu. Hit "Create" and you're done!

Let's proceed.

Step 7: MySQL, Databases, and That Kinda Stuff.

Next up, we're going to setup a database.

This is a simple, yet important, step in setting up your cloud. The database is needed to store your accounts.

Okay, Let's setup MySQL. Go to webmin and click on the unused modules, and then click on MySQL.

There should be something like an install button or link, press that one and you're set. Webmin will begin installing MySQL on your PiCloud.

After the installation you should be in the MySQL Window. Here click the button "Add database". You can name your database whatever you want, I've called mine "OwnCloud". the other options are already on the right settings, so please don't touch them. Wasn't that easy? Next up, we're adding an user to the database. It's almost as easy as creating the database. go to the "User Permissions" tab and hit "Add User". The Username should be "Owncloud", I'll leave the password up to u. Next, you'll need to select all the permissions except for superuser.

Done? Nice, click "Create" and you've successfully added a user.

To make sure the database and the cloud can work together we'll also need to setup PHP. This should be the most easiest thing you've ever done. ssh into your root account, and enter apt-get install php5 php-pear php5-mysql. The Pi now should start installing PHP.

Got everything installed, setup and ready? Nice, It's almost coming to an end now! Let's Proceed.

Step 8: OwnCloud, Your Own Cloud.

Okay, the real deal, your cloud. See those pictures? Awesome ay? Let's make it happen.

Open up webmin, and go to the "System software Packages" (It's in the System dropdown menu).

onee you're there, look at the "Install a new package" section, check the "Package from APT" checkbox and type "owncloud". Smash the install button and it should start the owncloud install.

For OwnCloud to work, we'll need an folder with the corresponding permissions on the harddisk.

ssh into your root account, cd into your harddrive and enter the following commands (Yep, Listman is back!):

  • mkdir cloud
  • chmod 750 /media/serverhdd/cloud

Once the installation is done, we can head into OwnCloud, you can do this by opening you browser, and typing: "YourIPAdress"/owncloud.

Here you should see a setup screen. Enter a username and password for your admin account, then type the path of your folder in the box, so mine is "//Media/serverhdd/cloud".

Fill in the database data and set the bottom box to "Localhost".

That's it! you now got a OwnCloud admin account.

Now, Let's add another user.

On the top right, click your user and hit "Users". it should take you to the user management page. Here you'll be able to add, delete and manage users. First create a group, I created "Normal Users". After that you'll be able to enter a username and password, select the right group and hit create.

Made an useraccount? well done! let's proceed to the last step!.

Step 9: Finishing Up!

Okay, nice! you've got everything setup.

When I was done with setting up the Raspberry Pi, I put it in the case and mounted it to the wall, after that I connected it to my Router again and booted it. When it booted it should work like a charm, with my cloud being on "IPAdress"/Owncloud, but shit didn't work.

after some research I found out that, of course, I needed to start the webmin service after rebooting. So i ssh'ed into my root account and entered service webmin start. After that things worked like a charm.

From now on, you'll be able to acces your cloud from anywhere in the house by typing your ip / owncloud in any browser. you can even add accounts for your parents, roommates, etc.

Thanks for following this instructable!

-JvHCreations.

<p>downloaded this for future study. No doubt there's a way around having an<br> dynamic IP address. My WISP charges $10 per month extra to have a <br>static IP address, for that money I'd upgrade my Dropbox account. The <br>only advantage to have my own server is that I could store content that <br>would violate the TOS of the commercial cloud storage</p>
<p>Isnt FAT32 limited to 32gig? Is this just for the tools, and the rest can be a 5tb blob?</p>
<p>Ok so I got to the MySQL setup and when I got to start MySQL it fails, every time. I have googled it and no answers, what could be the problem?</p>
<p>Hmm, very interesting. I'm sorry but I can't think of anything that could be the problem so I would recommend to reformat the SD card try a new clean install.</p>
<p>Did you run the whole MySQL install from webmin? It's a quite long one, so make sure to finish the whole installations.</p>
<p>I ran it all from webmin and it only asked me to click on a link to download. I let it run and then it seemed to be done. Did I miss something?</p>
<p>Ok, so I just deleted the MySQL module from webmin and reinstalled it for the same result. It definitely finished the installation this time. What next?</p>
<p>For those of us without a keyboard monitor lying around are there any variants of the Raspian OS images that are pre-configured for headless operation. Something that already has the first part of Step 4 integrated such that the PI can just be plugged into a router and be ready for SSH from a PC?</p><p>Or better yet, one that is pre-configured so that you can plug it in to the router and get directly to the Raspbian OS GUI desktop from a PC via some application?</p>
<p>If you got a linux Desktop, you can make it headless. Run &quot;wpa_passphrase WiFiName Password&quot; from your linux machine, and it returns a wifi &quot;key&quot;, you copy all the output and put it in &quot;/etc/wpa_supplicant/wpa_supplicant.conf&quot; and plug it into the raspberry. When you start the raspberry, it automatically connects to the wifi, and you can SSH into it straight away.</p><p>From There, you can do &quot;sudo apt-get install tightvncserver&quot;, and then open your VNC program on your main computer and the see raspberry desktop from there :)</p>
<p>what excatly is it that you 'plug into the raspberry'<br>you mean that you have to copy the wpa_supplicant.conf file to raspberry?</p>
I just used the standard raspbian wheezy image and it had ssh enabled by default. Was then able to install tightvnc server and use that to view the desktop GUI from another PC.
<p>tightvnc will only let you use X1, for true headless you want to use X0, this way you see what the pi is putting out through its actual video out. if you where to the ever plug in a monitor everything would be as you left it ;)</p>
Yes. You can ssh from the first install you do not need to change anything. From a fresh standard raspbian install just use terminal or putty for windows and ssh pi@ipaddress wi the password raspberry. You can then install x11vnc. Sudo apt-get update &amp;&amp; sudo apt-get install x11vnc. ... after that type x11vnc then use any rdc or vnc clnt to acess it headless. Message me if you need a better walk through. I will make an ible tomorrow
<p>i just got a rspberry pi thanks for the tutorial</p>
<p>when i ssh into root it keeps denying password its done it 4 times then i stoped </p><p>how do i fix that </p>
<p>Did you do the &quot;sudo passwd&quot;? Otherwise you can just ssh with pi and run the commands with sudo :)</p>
<p>How do you determine the Pi's IP address?</p>
<p>go to terminal</p><p>type &quot;ifconfig&quot; and press enter</p><p>the first &quot; inet &quot; is your pi IP.</p><p>good luck</p>
I recently setup something similar, except instead of connecting a single usb drive, I configured Owncloud to use a share from a NAS drive I have using the external storage add-in for Owncloud. Works really well and provides extra security for my data as the NAS box has a level of RAID built in.
<p>Meant as a note, not as criticism: at what point do you set a static IP address? There's no mention of it and confusion may arise.</p>
<p>But why format the external HDD as FAT32???</p><p>Surely you should be using a proper Linux file system.</p><p>BTW since ssh isn't set up properly, you want to make sure that the Pi is NOT accessible via external internet access.</p>
<p>Because all OS can read/write to FAT32 with no issues so if you format a drive as EXT4 (&quot;proper Linux file system&quot;) then you may have problems if you want to have the drive work with other OS. And despite FAT32's file size limitations of 4GB it works fine for most applications. </p><p>If you do have to work with a +4GB file then you could always throw in a cheap USB stick, format it as EXT4, NTFS, etc... and use it as a temporary storage drive. I had to do this when I was making CD/DVD iso files that would range from 700mb to 8.5GB. </p>
<p>Awesome Raspberry Pi project.</p>
how much would this totally cost ?
<p>Hmm, Let's see</p><p>1 Raspberry Pi which is around 30 Bucks,</p><p>1 8GB SD card, which is around 4 Bucks,</p><p>The internet cable and power supply I had laying around somewhere, so they didn't cost me anything, but the prices of those will be around 10 Bucks,</p><p>And last of course the 3D printed materials and wood for the lasercut were around 3 Bucks.</p><p>So the grand total of this project will be around 50 Dollars, depending on what you've allready got.</p>

About This Instructable

47,430views

655favorites

License:

More by JvHCreations:Lazy Arduino light switch Raspberry Pi Home Cloud 
Add instructable to: