loading

To start, this is my first Instructable. The reason I'm creating this it to hopefully help others with this process. Iv spent about a week and many hours trying different combinations of servers and tutorials that explain most of the steps but usually these are older and not relevant anymore. This is all new to me and I've been learning as I go.

Hopefully I will be able to explain how to setup a home Owncloud server that you can access away from home and have a NAS that you can access from any computer at home and have it act as a media server.

Pros and cons with this compared to dropbox or google drive.

1. Super low cost. Running a Raspberry Pi 2 and a 1A HDD on a 2.5A outlet 24/7 will cost less then 20$ a year in the united states. Actually its around 13$ a year at an average of .12 cents per kWh, now that's if it were at full load year round and chances are the majority of the time it will use less power then 2.5A.

2. Way more storage then google and dropbox offer for free. Rite now Google Drive offers 15 gigs for free. I'm using an old hard drive that is 160 gigs. So that means I have around 150 gigs of data I can access anywhere I have an internet connection. 100 gigs on gdrive will cost around 24$ a year and 1Tb will cost you about 240$ per year. So you can see the savings can quickly add up.

3. Depending on your area this can be either good or bad, your internet. I have a 60 mbps down and 4-5 up. Around 8 mbps equals 1 megabyte. So if I was away from home downloading a file to my phone or computer from my cloud at home, it would take a while because my upload speed uploads at less then 1 megabyte per second. Now if you are lucky enough to live in an area with a really high upload speed then you will have better results then myself.

Now I will be showing you how to set this up headless which means no mouse, keyboard or monitor will be connected to the raspberry pi during or after setup. I will also recommend using an Ethernet connection and will not explain how to set this up on wifi.

This will not have any sort or RAID or backup redundancy since this is mainly a test and a learning experience to see if I will even use this in everyday life, and I only have 1 HDD. However there are tutorials out there on how to set up RAID with the raspberry pi using mdadm and a google search should explain more.

This will require the following:

Time, downloading and updating itself can take a couple hours then the install itself can take a few hours depending how good you are with navigating the terminal.

Raspberry Pi (I use a Rpi 2 because its faster and a Rpi 3 would be better)

SD Card that is 8Gb or larger

USB HDD size of your wish

If using a SATA drive you will need a SATA to USB adapter

A powered USB hub (I made one from a regular unpowered hub)

Ethernet connection to your network.

DISCLAIMER

I am no IT expert in anyway and have never taken a networking class so therefor I can make no guarantee that your network will be invulnerable to attacks, however we will be using methods to help harden the server but it will still be open to the world.

Without farther adieu lets begin!

Step 1: Installing the OS and Hardware Setup

Lets start with a fresh install of Raspbian by going here https://www.raspberrypi.org/downloads/raspbian/

Also download Win32diskimager at https://sourceforge.net/projects/win32diskimager/

We will be using SSH to gain access to our Pi so download Putty here http://www.putty.org/

Now install Win32diskimager. Plug your flash drive in and open up the diskimager. Make sure the correct drive is selected under device and then browse for the copy of Raspbain you downloaded earlier. Select it and then click write. Let it finish

Now you can insert the SD card, connect your powered USB hub to the Pi and connect your hard drive to the powered hub. After this find a place where you can connect the Ethernet cable and connect power to it. After you find its final resting home, plug it in and we will continue on the next step.

Step 2: Initial Setup

Now after everything is plugged up and booting up. It's time to figure out the internal IP of the RPi. I do this by opening up my router and viewing the DHCP client list or attached devices depending on your router brand. Also for background I have a Belkin as my main router and I have a Netgear set up as a repeater/switch.

My internal IP for the pi is "192.168.2.6" as you see in the picture above.

Now that we have the IP, open up Putty.

Where is says host name or IP, type in your IP for the RPi. So I would type in 192.168.2.6

Now click "open" at the bottom and a black box will pop up.

It will say "login as:" By default this will be "pi", so enter pi, now it will ask for the password, this will be "raspberry".

Congratulations, you are now remotely connected to your Raspberry Pi!

Now that the whole world knows your password, it's time to change it. Do this by typing in

sudo raspi-config

The sudo simply elevates that command to superuser level.

A nice trick with putty, if you copy text here, you can paste it by right clicking inside the putty terminal.

Now a grey and red box will pop up, expand the file system, change your password to a more secure one and if your using the first raspberry pi, I would recommend overclocking it slightly to help out. I did not overclock my Pi 2

When your done doing the above, navigate to finish and let it reboot.

When it reboots, you will loose connection. Give it a couple minutes to boot back up, in the bar at the top of putty, right click and choose restart session, if it fails, wait a few and try it again.

Now you will log in as "pi" and your new password you just made.

Step 3: Making Sure All Is Up to Date

Now that you have logged back in, type in

sudo apt-get update

Let what work then type in

sudo apt-get upgrade

If there are updates it will ask for (Y/N) type y to continue. This may take a while depending how many updates there are.

Now reboot with

sudo reboot

Now log back in.

Step 4: Setting Up an IP

Now currently the router will assign the pi an IP address whenever the power is lost, this may be the same or it may be a new one, this is something we do not want so I will show you how to give the pi its own static IP that will not change.

We will need 3 things.

  1. The address you want you PI to be on. (I chose a high number to prevent the router from assigning the same IP to another device.
  2. The netmask
  3. The Gateway

To find the netmask type in

ifconfig

To find the Gateway type

route -n

Now we will use a text editor called nano. You use your keyboard arrows to navigate around. Type this to bring up the file

sudo nano /etc/network/interfaces

To clean the file up delete the lines that have to do with wlan which is wireless LAN or WIFI because we will not be using this. It will look like the picture above after that. Now we will begin to add the information we got earlier. The file should look like below.

auto lo 
iface lo inet loopback

auto eth0
# allow-hotplug eth0

iface eth0 inet static
address 192.168.x.x	The first x will match your current IP you used to connect to the pi, the second will be your choice
netmask 255.255.255.0
gateway 192.168.x.x	This must match the one you got earlier from route -n

Now press Ctrl + O to save then Ctrl + X to exit, now reboot. You will have to close putty out and open it back up with the new IP you assigned to the PI. When you open it back up, type the following to make sure it changed.

ifconfig

I changed mine to 192.168.2.65 because there will be no chance the router will have assigned 65 IP addressed to that many devices on my network. Check out the picture to see the change take effect for me.

If it shows the IP you assigned to it then congrats, your Pi is now static, if not then double and triple check that the file config looks exactly like mine only with your gateway and address.

Step 5: Creating Folders and Mounting HDD

I have a freshly formatted NTFS HDD all ready to go.

Lets make some folders, im putting these in the media folder. To get there type

cd /media

cd is change directory and /media is the location. You must have the / or it will not work. Now lets create a new folder here.

sudo mkdir nas

mkdir is make directory, so we are using superuser to create a folder called nas in the media folder. You can name this whatever you like but I'm keeping it simple to remember.

Lets find out some drive information. Type in

sudo blkid -o full -s UUID

Copy the UUID, in putty to do this, highlight the number and left click on it. As you see, mine is 3A8E61238E60D941, so lets open up the config folder for the disk.

sudo nano /etc/fstab

It will look like the file above. Now we will add a line to make the HDD mount to the folder we just made when the Pi boots up. Add the following to the bottom of the drive list like in the picture above.

UUID=xxxxxxxxx   /media/nas    ntfs-3g     defaults,permissions      0       0

Replace the xxxxxxx with the UUID you just got. This line is saying we will mount the drive to the nas folder. The ntfs-3g is the file system of the drive and the next part is the permissions. We are using the UUID because if you plug in another drive the drive letter may change at next boot and mess your files up.

Refer to my picture above and save and exit the file, now reboot. login and go to your media folder, remember type

cd /media

ls	type this to show folders

As you see in the picture above, my nas folder is highlighted green, this means the HDD is mounted to that folder and we are successful!

Now lets make another folder on the drive called owncloud

cd /media/nas

sudo mkdir owncloud

Now we have a folder for our owncloud files.

Step 6: Setup for Installing Owncloud

Now we are done with the initial setup of setting a static IP and making some folders along with mounting a HDD.

Now lets get owncloud installing! Lets start by adding the repository for owncloud. But first we need to elevate to superuser by typing

sudo -i

now type this in to add the owncloud repo to the apt update

echo 'deb <a href="http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_8.0/" rel="nofollow">http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_8.0/</a> /' >> /etc/apt/sources.list.d/owncloud.list

and now we will install the release key for it, do this one by one hitting enter after each

cd /tmp

wget <a href="http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_8.0/Release.key" rel="nofollow">http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_8.0/Release.key</a> 

apt-key add - < Release.key

After that does its thing, enter

apt-get update

It should do some updates and let you know when its done.

Step 7: Owncloud Install

The best thing is Owncloud will install everything for us that it needs to run, simply type

apt-get install owncloud

Choose yes to continue and after a while a bog will pop up to set up a MySQL password. Please choose a very secure password for this and make note of it for future reference. You wont need it again for this tutorial but you may in the future.

Let that finish, it will take a while. After that finishes up, lets login to the MySQL database

mysql --defaults-file=/etc/mysql/debian.cnf

Now we will create a database for us to use. Enter each line separate. To keep it simple lets keep the database name as owncloud and keep owncloud as the @localhost. However you should change the password to something secure as well

CREATE DATABASE owncloud;
CREATE USER owncloud@localhost IDENTIFIED BY 'mysecurepassword';
GRANT ALL PRIVILEGES ON owncloud.* TO owncloud@localhost;
flush privileges;
quit

Before we start set up the user data for owncloud, we need to change the permissions for the owncloud data file. Do this by entering the following being mindful if you chose different folder names then the ones I chose.

sudo chown -R www-data:www-data /media/nas/owncloud

After we do that, go to your browser and type in the ip you gave the server earlier followed by /owncloud Mine would look like this, 192.168.2.65/owncloud

When you type that in, it should take you to the admin setup page. Follow the picture to see how to set it up.

Pretty much its create your admin account, type the directory you made earlier when we made the folders and mounted the HDD then use MySQL and NOT sqlite. Then input the information we set up in the MySQL database above.

Congratulations, you now have a working owncloud server... kinda, rite now its only useful on your home network and not very secure. Lets learn how to secure it!

Step 8: Updating

Now that we have owncloud set up and working, you may see a notification saying there is an update available. If you click on the username in the top right corner, you can select admin. This will bring up a page to change settings, now you will notice I have some errors along with an update.

Now if you scroll down and click on update, after a few, you will see a long box of errors pop up. This means owncloud does not have permission to change the contents in that folder, lets fix that. According to the owncloud admin manual they provide. You should set folder permissions as soon as you can after the install and they provide a nice little script. Since we used the default install path for owncloud, this is not where file uploads are stored, we can simply copy and paste there code and have it set everything for us.

First elevate to superuser

sudo -i

Now copy and paste the following into the terminal.

#!/bin/bash

ocpath='/var/www/owncloud'
htuser='www-data'
htgroup='www-data'
rootuser='root'

find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750

chown -R ${rootuser}:${htgroup} ${ocpath}/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/config/
chown -R ${htuser}:${htgroup} ${ocpath}/data/
chown -R ${htuser}:${htgroup} ${ocpath}/themes/

chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess

chmod 0644 ${ocpath}/.htaccess
chmod 0644 ${ocpath}/data/.htaccess

Press enter again to execute the very last command if its still typed in.

This according to owncloud will set all proper permissions to harden the server and make it work properly. That includes updating.

Step 9: Enabling SSL and Only Using HTTPS

First lets enable SSL on our server to help secure the connection. Run these commands separately

a2enmod ssl		## this will enable the SSL module
a2ensite default-ssl	## this will tell it to use the default-ssl
service apache2 restart		## this will restart apache2

Doing this will allow you to access your owncloud using SSL but only if you type in https:// first. you can test this by typing https:// first. to see if it works, its normal that you get an error and have to add the exception in order to access the page but you should now see a lock in the address bar.

Now lets make it always use https even if you dont type it in. Lets go to the sites-available folder where the SSL settings are. As as side note, if you open a file to edit text and its blank, make sure you typed in the correct directory and filename, double check this by using ls. All the files we edit will have text in them so if you open a file with nano and its blank, you did something wrong.

cd /etc/apache2/sites-available

ls		## once again this will list the files in that folder

we want the file that says 000-default.conf so lets edit that.

sudo nano 000-default.conf

We will be editing the server name line by removing the # and putting in your local IP or domain name if you have one. We will also add a line that will redirect all traffic to the HTTPS version. These are the lines to add/edit

ServerName cloud.owncloud.com

Redirect permanent / https://cloud.owncloud.com/

Check out the picture above if you have questions on what it should look like.

Now reboot your pi and close out the owncloud page. Type in your IP (ex. 192.168.2.65/owncloud) and it should turn into https://192.168.2.65/owncloud and if it did then we are one step closer to being more secure.

As a side note, once we set up owncloud to be accessed from your external IP, you must use the https or it will not work.

Step 10: Enhancing Security Some More

If you have been checking the admin page, you will have noticed that as we add more layers of security and get rid of errors, more errors will pop up. We are close to having them all taken care of, I promise!

Now we have the error "The "Strict-Transport-Security" HTTP header is not configured to least "15768000" seconds." lets fix this by going back into the sites-available folder.

cd /etc/apache2/sites-available

ls

Now there should be a folder called default-ssl.conf, lets edit that.

sudo nano default-ssl.conf

Under where it says serveradmin add the following

Header always add Strict-Transport-Security "max-age=15768000"

Save and exit the file, Now type in the command

sudo a2enmod headers		## This enables the headers module in apache2. 

Now reboot your Pi and close the owncloud page. Wait for the pi to boot back up and log back into owncloud and go to the admin page, that error should be gone now, if now double check that it looks like my picture and you enabled the headers correctly.

Step 11: Speeding Things Up

Now if all is going well, you should be left with one error, "No memory cache has been configured.". From what i understand is setting this up will help speed up load times of the pages on the server. I personally just don't like seeing warning messages so that's why I set it up. Anyway lets begin by installing php-apc

sudo apt-get install php-apc

That will setup and you will need to press Y to continue, when its done, navigate to

cd /etc/php5/apache2/conf.d

Now open up the configuration file, there should only be one line.

sudo nano 20-apcu.ini

In this file we will add a couple lines

apc.enabled=1
apc.shm_size=12M*		## *where this is the size of your desired cache
apc.ttl=259200		## this will determine how long cache is kept(time to live) time is in seconds, this number represents 3 days

I used 20M, check out my picture if you have questions of what it should look like. When your done, save and exit.

One more change for this and we should be done. Go here

cd /var/www/owncloud/config

When you list the files, there should be one called config.php open it.

sudo nano config.php

Now inside the “CONFIG array” we need to add the following line

'memcache.local' => '\OC\Memcache\APCu',

See the picture above for an example. Now save the file and reboot the server and head to the admin page. There should be no errors like mine!

Step 12: Hello World

So we are very close to having the server set up. It now should be error free and data folders set up. Now for the most important part. Accessing the server from the outside world!

You must have port forwarding enabled for the IP your pi is on, forward port 443. Many routers are different so google your routers model number on how to port forward.

There are two ways of doing this, I will explain both, one is super easy the other is the manual way of doing it.

Go to google and type in "my ip" and it will show you your external IP address.

Easy way, go to your web browser and type in https://yourexternalIP/owncloud

It will take you to a page like above saying untrusted domain. Simply click add as trusted domain. Proceed to login and it will ask you again, click on yes and you are good to go.

Iv been playing around with this a lot and it seems the only way to access your owncloud externally is you must type in https://yourexternalip/owncloud or it will not work. So if you give it out to friends or family to give them cloud storage, they must remember to include the https or it will result in a webpage not found.

The hard way, if you followed the above, you should still check the following out. If you did the above, you will not have to add the line. Just check out how it created the line for you.

Navigate back to where we just were, and then open the config

cd /var/www/owncloud/config

sudo nano config.php

Under the trusted domains array, we need to add a new line with our external ip. The new line will look like this

1 => 'xx.x.xxx.xxx',		## Put your real ip in place of the x's

Look at the picture for reference.

After you finish this step, you will have a fully working personal cloud you can access anywhere you have internet. Sweet rite!

Step 13: User Preferences

By default the upload limit is pretty small and since we changed the permissions of those files, we cant directly edit them from the admin page, but that's no problem, go here

cd /var/www/owncloud/

now this file is .file so by typing ls, it wont show up. We have to type ls -f and now it will show up if you want to see it, or we can just directly edit it.

sudo nano .htaccess

use the arrow key to scroll down and find the php values, we will be changing the lines

php_value upload_max_filesize<br>php_value post_max_size

I set mine to 5G so I can upload large iso files with no problem. You can set yours to whatever you want or leave it alone. Another reason we are editing the file directly, the admin page says the file upload limit is 2G max, well if we put 5G in the settings file manually, it will allow us to upload 5G like we asked.

Now save and exit, you do not have to reboot, just reload the webpage.

Aside from that you can set up encryption to your files and change some other things around, google will better explain that stuff.

There are also plugins you can add to owncloud like virus scanning for uploaded files and some other things but hold off on that for now, lest set up the samba server for local computers then we will create a backup of the SD in case something happens we can start with a fresh setup.

Step 14: Samba

Now that owncloud is setup and working, lets get the local network file share set up. If you are happy with just the cloud then you can stop here but where is the fun in not learning anything else. Start by installing these

sudo apt-get install samba samba-common-bin

Lets create a backup of the config file in case we make a mistake.

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.old

These next steps are really user preference, you can choose to have a shares with no passwords or you can choose them with. You can also configure shares for different people with there own username and passwords if you like. First I'm going to keep it simple so you can get your feet a little wet. Iv spent hours in frustration with this so hopefully I can keep you from the same pain.

Before we get ahead of ourselves, lets create a folder for all users on the network with no password in our nas folder or whatever you named it.

sudo mkdir /media/nas/allusers

It took me a long time to figure this out so I will save you the struggle. Long story short, we have to give just this allusers folder full permissions to read, write and execute. From there we can edit what users do in the samba config file.

sudo chmod -R 777 /media/nas/allusers

Now we have full access to it, lets make it so we can view it on our network.

We are going to edit the samba config to do that so,

cd /etc/samba

ls

Make sure your backup is there. Now

sudo nano /etc/samba/smb.conf

Now use Ctrl + V to scroll all the way to the bottom and add this

[All Users]   comment= All users
   path= /media/nas/allusers
   browseable = Yes
   writeable = Yes
   only guest = no
   create mask = 0777
   directory mask = 0777
   public = yes

Whats in the [ ] will be what you see on the network

Comment is just a comment

Path is where you make your folders for the share

The 2 mask you see are the permissions, this is where you can prevent people from doing stuff like editing files or creating folders.

Public, if this is set to no, it will require a password to access the share even if you have not set one up.

Now save changes and restart samba

sudo /etc/init.d/samba restart

After that, under networks it may take a few for RASPBERRYPI to show up and from there you can click on it to access your shares, another way to access it however, open up run, windows key + R, and type \\IP.you.gave.PI. See images above.

Now you should be able to make new folders and add files to it.

Step 15: Samba Security

Now this alone can take pages with all the different settings and configuration options so I will try to explain it as best I can. I'm also learning as I go so bare with me, I have been testing a lot and using trial and error, mostly error haha but anyway here is what iv learned so far for the most control over stuff.

For example, we want to create a share for sally, bob and mom. In order to do this we must also make user accounts on the pi for each of them, after that we can make a samba account for them with each of there own passwords then we can make the shares for them and set it up so they can only see. It's actually only a handful of commands, the problem is handling the passwords as you will have the linux user password and you will have the samba password.

Another interesting thing I found out by accident. Example, we set up a share for all users on the network with no password correct? Well yes we did if you skipped to this part. Anyway I was messing with creating another linux user and samba user and used my name. My windows computer is also named after me. After I created this new account and added a samba share for myself. I went to browse the folder and it would not let me without a password. But wait, we have a folder that is open to all users, why must I put a password in to see this open share plus my own? Turns out if your samba username is the same as your windows username, you must enter you credentials to access any of the shares including the one without a password. Its kinda neat now that I know that but very confusing at first.

Check this link out to learn most everything about samba.

https://www.samba.org/samba/docs/using_samba/toc.h...

Step 16: Creating Samba Users

Lets create a share for Bob! First lets make a user folder for him in the home folder

cd /home
sudo mkdir bob

Now lets actually add him, this command will link bob to the folder you just made, the /bin/false -r will prevent bob from being able to login to the terminal.

sudo useradd -d /home/bob -s /bin/false -r bob

Create a password for bob, it will ask you twice. This is the linux/raspberry pi user password, not the samba password, we arnt there yet.

sudo passwd bob

Now its time to create a samba username and password, the next command does both

sudo smbpasswd -a bob

The next commands add permissions and set bob to the users group which can be used for other things when setting up a share.

chown bob bob
chgrp users bob

Easy as that, just do the above for every user you want to add.

Kudos to this page for helping me out! It was posted in 2008!!

http://ubuntuforums.org/showthread.php?t=839414

At the of this, I will try to post the sources that helped the most.

Step 17: Creating Shares for Samba Users

To create the shares, just go back to the smb.conf file and add them according. Here is an example

[Bob]<br>    path = /media/nas/bob
    read only = no
    writeable = yes
    browseable = yes
    valid users = bob
    create mask = 0777
    directory mask = 0777

[Sally]<br>    path = /media/nas/sally
    read only = no
    writeable = yes
    browseable = yes
    valid users = sally
    create mask = 0777
    directory mask = 0777

Ok so lets say you created a user for bob and sally. Don't forget to make folders for them in the nas folder. The valid users line will require you to enter a password to view the shares even if you have one for all users with no password. What this line does is checks to see who logs in and shows shares based off of that. So if bob logs in, he can only see bob plus the all users share we made earlier, if sally logs in, she can only see the sally share plus the all user share. You can also create another share and have both sally and bob as the valid user so they can share a folder between themselves. And the 777 mask give them full permissions to those folders, you can change this as needed.

I think I'm going to leave the samba stuff at that, there is tons of documentation on samba and setting up a network exactly how you want it.

This will help more with setting up users and security.

https://www.samba.org/samba/docs/using_samba/ch09....

Step 18: Minidlna

Minidlna will turn your pi into a media server! This is probably as simple as it gets! We download it to out pi, make a media share in our samba with the permissions you choose, I keep mine unlocked, and point minidlna to that folder and any media in that folder will get picked up on any device on your network that supports DLNA. For instance you can download an app on your phone to view the media server and stream videos to your tablet or phone. Our TV is a smart TV and supports this so that is pretty neat. If you got creative you could install transmission and go from there, but I will not go into any of that.

Anyway

sudo apt-get install minidlna

Also make a media directory and give permissions

sudo mkdir /media/nas/media
sudo chmod 777 /media/nas/media<br>

Now lets make a new share, the one is an example of what I made

sudo nano /etc/samba/smb.conf

[Media]<br> path = /media/nas/media
 public = yes
 writable = yes
 comment = Media
 guest ok = yes

Now we can configure minidlna. You have the option to sort movies, pictures and music. I will show a picture of what this looks like above. By default they will have a # in front of them which means they will not be read. You can comment this if you would like to sort your media library or you can choose for it to use one directory. Up to you but i will post pictures of both setups to give and idea.

After that scroll down some more until you find friendly name and name this what you want it to show on your network, make sure it does not have a # in front of it.

Now you can save the file and reboot the pi.

Step 19: Creating a Backup!

OK so now everything is setup and working, it would be a shame for that SD card to corrupt on you in the next week or so. Lets create a backup that can be reinstalled in case something bad happens.

Properly shut down your pi

sudo reboot

wait a couple minutes for it to shut down, now remove your SD card and plug it into your computer.

open up Win32diskimager and type out the path and the name of the file followed by .iso

Now hit READ!!! DO NOT hit write!!!!!!

Since we expanded our filesystem, it will use 8GB of disk space for the backup.

Now if something happens simply install that backup to an SD card and pop it in you pi and you will have a fresh working setup!

Step 20: Final Notes

Congratulations! We have come a long way and hopefully everything went well for you.

We just scratched the surface for most of this and now that your feet are wet and your curiosity is going, its time to start searching google for anything else you would like to configure or learn about.

Once again I made this because I had a very hard time finding a complete article that left Owncloud or samba working without some sort of problem. I hope I have covered anything issue you may have ran into, if not leave a comment and hopefully I can help you solve the problem. I will also list my sources below that helped most.

Overall Iv spent about a solid week writing this and researching this stuff in my off time. So if I can help a few people out, I will be super happy and maybe I will post more stuff about the Pi or general electronics to expand my knowledge and yours!

If you wish to be more secure then I would suggest changing the default ports these services use to higher and uncommon ones to make it harder for someone to try and get into your network, just remember to port forward them in your router if you would like remote access. I only have my owncloud set up to see the world.

Sources that were super helpful!

https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=111709

https://forum.owncloud.org/viewtopic.php?t=31221

http://superuser.com/questions/625421/change-owncloud-data-directory-to-an-external-drive

https://www.howtoforge.com/tutorial/owncloud-install-debian-8-jessie/%5C

http://projpi.com/diy-home-projects-with-a-raspberry-pi/pi-owncloud-drop-box-clone/

https://doc.owncloud.org/server/8.0/admin_manual/installation/installation_wizard.html

https://www.howtoforge.com/tutorial/debian-samba-server/

https://www.stewright.me/2013/05/turn-a-raspberry-pi-into-a-nas-network-attached-storage-server/

http://ubuntuforums.org/showthread.php?t=1723762

http://ubuntuforums.org/showthread.php?t=839414

https://www.samba.org/samba/docs/using_samba/ch09.html

This instructable inspired me to do this but was made in 2012 so most of it was outdated and almost all pictures were broken

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

<p>no chance to start apache =&gt;&gt; </p><p>server certificate does NOT include an ID which matches the server name</p><p>ah00526 syntax error ServerName takes one argument, The hostname and port of the server</p>
<p>sudo reboot reboots the system</p>
<p>Hi,</p><p>Some errrors are coming while doing STEP 6:</p><p>Please see screenshot .</p><p>So far everything goes fine.... I don't know what I'm doing wrong..???</p><p>Can you advice???? Thanks a lot!! Joop</p>
<p>Resolved ..... followed another road.....</p><p>thank you!!!</p>
Hi JoopT can you tell me witch road? I've got same problem
<p>I did follow another road to install owncloud described in:</p><p><a href="http://www.htpcguides.com/install-owncloud-8-x-raspberry-pi-for-personal-dropbox/" rel="nofollow">http://www.htpcguides.com/install-owncloud-8-x-ras...</a></p><p>and this is working perfect for me on a RPI2B and als on a RPI3B.</p><p>Hope you get it working too!!!</p><p>Joop</p>
Hi, <br>Because there came no reaction/solution on my problem I choose another road described in :<br>http://www.htpcguides.com/install-owncloud-8-x-raspberry-pi-for-personal-dropbox/<br><br>And after that I have a perfect working OWNCLOUD on my Raspberry Pi2B.<br>I also followed this same road on a Raspberry PI3B and also here it is working fine!<br><br>73,<br>JoopT
<p>A few of the steps are confusing. For those who are struggling like I was, here are the solutions.</p><p>Step 6:</p><p>1: sudo -i</p><p>2: sudo echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_8.0/ /' &gt;&gt; /etc/apt/sources.list.d/owncloud.list</p><p>Note: if you see this after you already entered the incorrect command, you will have to run (rm /etc/apt/sources.list.d/owncloud.list) and try again.</p><p>3: wget http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_8.0/Release.key</p>
<p>I had finished a couple of days ago, the unique problem now was the step 5.</p><p>I put &quot;auto,rw,defaults,permissions&quot; after the file-system tipe and now is working great.</p><p>thanks for the help and the post.</p>
<p>hi, I love the post but I had a problem at step 8:</p><p>I did sudo -i and then I copy pasted the next comands to the terminal.</p><p>this runs well:</p><p>#!/bin/bash</p><p>ocpath='/var/www/owncloud'<br>htuser='www-data'<br>htgroup='www-data'<br>rootuser='root'</p><p>but after this comand everything failed.</p><p><br><br>find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640<br>find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750<br><br>chown -R ${rootuser}:${htgroup} ${ocpath}/<br>chown -R ${htuser}:${htgroup} ${ocpath}/apps/<br>chown -R ${htuser}:${htgroup} ${ocpath}/config/<br>chown -R ${htuser}:${htgroup} ${ocpath}/data/<br>chown -R ${htuser}:${htgroup} ${ocpath}/themes/<br><br>chown ${rootuser}:${htgroup} ${ocpath}/.htaccess<br>chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess<br><br>chmod 0644 ${ocpath}/.htaccess<br>chmod 0644 ${ocpath}/data/.htaccess</p><p>and now I can't do anything, (neither do &quot;reboot&quot;) how can I get back the privileges?</p><p>sorry for my english. Thanks for helping.</p>
<p>It appears the formatting got messed up a bit when copying the stuff over, I just edited step 8 and it should work now. If it still fails check this out </p><p><a href="https://doc.owncloud.org/server/8.0/admin_manual/installation/installation_wizard.html" rel="nofollow">https://doc.owncloud.org/server/8.0/admin_manual/i...</a></p><p>This along with many other links helped me a lot. I ended up having to do all of this a couple of times myself to get everything working properly. I posted all my sources at the end of this instructable.</p><p>Hopefully this will push you in the right direction, I'm on vacation now and away from my raspberry pi so I can't recreate the problem. </p>
I have not, this is the first time I'v done a headless setup, I'll have to check it out sometime though.
<p>*Very* nicely done!</p><p>I've been using ownCloud on the Pi since the Pi came out. It gets better with every upgrade of the software and hardware.</p><p>Have you tried using Minibian as the OS for your server? It gets rid of all the cruft such as the GUI that you'll probably never use since you're SSH'ing into the server.</p>

About This Instructable

10,818views

45favorites

License:

More by Ksp3cialK:Intresting Stuff Raspberry Pi 2 NAS with Owncloud, Samba and MiniDlna 
Add instructable to: