Skip to main content

Set up a Raspberry Pi OwnCloud server

 

How to set up a Raspberry Pi ownCloud server

 

How to set up a Raspberry Pi ownCloud server

There are plenty of ways to get cloud storage. You can turn to services like DropBox or cloud services from major companies like Apple and Google. But you don’t necessarily have to pay money to get reliable cloud storage – and you don’t necessarily have to trust giant companies like Apple with all of your private files. You’re more than capable of replicating these services on your own. You’ll just need some storage (like an external hard drive) and a device. You’re reading The Pi, so you know where this is going: we’re going to use a Raspberry Pi. So grab your tools!

You’ll need all the usual stuff plus an Ethernet cable and an external storage device (optional, but recommended – if you’re going to set up ownCloud, you might as well give yourself plenty of storage space).

We’re going to install DietPi, a super-lightweight operating system for the Raspberry Pi. Then we’re going to use ownCloud that works on DietPi.

 

Step 1: Install DietPi on your Raspberry Pi

Your DietPi installation process is the same as with most other Raspberry Pi operating systems. Grab the disk image here, unzip it with the program of your choice (7-Zip will work), and then write the disk image to your microSD card with the program of your choice (Win32 Disk Imager on PC and Disk Utility on Mac will both work).

Step 2: Write down your IP address and log into DietPi

With DietPi on the microSD card and your Pi connected to the internet via Ethernet cable, go ahead and boot up. DietPi should print out your IP address even before you log in. We’re going to need that, so go ahead and write it down.

Log in with the username root and the password dietpi (you can do this on the Raspberry Pi itself or just SSH in from another computer). It’s your first time logging in, so DietPi will update automatically. Wait that out and then hit enter to reboot. Then log back in!

Step 3: Install ownCloud

Once DietPi has rebooted and you’ve logged back in, you’ll be able to install new software – and that’s exactly what we’re going to do.

 

The program we want is called ownCloud.

In the DietPi menus, navigate to Software Optimized – Select DietPI optimized sogtware for installation and then to 47 OwnCloud: your very own cloud (eg: dropbox). You’ll use the space bar to select and Enter to confirm.

 After selecting ownCloud, you’ll be sent back to the menu you started from. Navigate to Install – Go >> Start installation for selected software and press Enter. On the following screen, select OK and hit Enter again to indicate that you’d like to begin.

 

DietPi will install ownCloud and then reboot (yes, DietPi really likes to reboot).

Step 4: Access the ownCloud web interface

Let the Pi reboot and then put it aside for a moment. Hop on another device and open a browser. Remember that IP address for your Raspberry Pi? The one you wrote down? Go ahead and type that in the address bar of your browser between http:// and /owncloud. For instance, mine looked like this: http://192.168.0.103/owncloud/.

What you’ve types here is the URL for your ownCloud web interface. And the first thing the web interface will do is run the setup wizard.

The setup wizard will prompt you to create an admin account. Choose your username and password, then take a look at the apps that ownCloud recommends you download. Take the program’s advice.

After all this, you’ll find yourself logged in to the ownCloud web interface.

 Step 5: Use your storage!

Your Raspberry Pi ownCloud server is now set up and you can start uploading files in the storage by clicking the plus symbol above the list of files and choosing Upload. You can hop into this interface with your browser on just about any device on your network, as well as through the ownCloud smart phone apps. You’ll need your username and password, of course, and you’ll have to make sure your Raspberry Pi is on when you need to access your cloud.

 

 

But wait – on your network? Your cloud storage is pretty limited if you can only use it in your own home. Let’s do just a couple more steps and make our cloud storage available anywhere.

Step 6: Set up port forwarding

If you want to access your ownCloud server from outside your home network (and you almost certainly do), you’ll need to set up port forwarding in your router’s admin interface and configure trusted domains in ownCloud’s settings.

Let’s take care of port forwarding first. Go ahead and access your router’s settings by typing your router’s IP address into a browser address bar. We’ll all have the same goals here, but our settings may look a little different. For instance, my router’s settings look like this:

Service Port: 80
Internal Port: 80
IP Address: [your Pi’s IP address]
Protocol: TCP
Common Service Port: HTTP

Change your settings so they match ours above (again, they won’t necessarily be in the same order or layout). Where we have [your Pi’s IP address], you should, of course, put your Pi’s actual IP address. This is the IP address you wrote down way back in Step 2.

That takes care of the router. Now for ownCloud.

Step 7: Configure trusted domains

With port forwarding set, ownCloud’s trusted domains setting is the last obstacle to enjoying cloud storage from outside your home network.

Hop on your Raspberry Pi and log into DietPi. Enter this command:

sudo nano /var/www/owncloud/config/config.php

We’re going to edit this config file and add your public IP address to the list of trusted domains. My config file looks like this:

<?php
$CONFIG = array (
'updatechecker' => false,
'instanceid' => 'oczs3u2vnel0',
'passwordsalt' => 'nRmHalWK8DQBNJ2bUicukJsg8Ys4Y2',
'secret' => 'fMP9Uix9Ub965r2ukRzKVgmn0ZK8GRSWWo5l1x9zseRZFkxS',
'trusted_domains' =>
 array (
 0 => '192.168.0.103',
 ),
'datadirectory' => '/var/www/owncloud/data',
'overwrite.cli.url' => 'http://192.168.0.103/owncloud',
'dbtype' => 'sqlite3',
'version' => '9.1.6.2',
'logtimezone' => 'UTC',
'installed' => true,
);

See that part I put in bold? You should have a similar section in yours, and that’s were you’re going to make our changes. Right above where the parentheses close, add a new line that reads 1=>'[your public IP address]’ – (where the part in brackets is, of course, your actual public IP address and not just those words). If you don’t know your public IP, you can just check by asking Google “what is my IP address?” Once you’ve got it right, the section will look like this:

'trusted_domains' =>
array (
0 => '192.168.0.103',
1 => '[your public IP address]'
),

Our new line is in bold in this example.

Now we’re all set. Exit the editor and save the config file by pressing Ctrl+X, then Y, then Enter.

Now you can log in to your ownCloud server from outside your home network by browsing to http://[your public IP address]/owncloud/. Note that we’re using the public IP address now instead of your Raspberry Pi’s IP address. That’s it – you now have cloud storage that works wherever you are!

 

 

 

 

Comments

Popular posts from this blog

How to Setup Fail2ban on the Raspberry Pi or use the Pi- Hole setup

    In this Raspberry Pi Fail2ban tutorial, we will be showing you how to set up and configure the Fail2ban software on your Raspberry Pi. Fail2ban is a crucial piece of software when it comes to improving the security of your Raspberry Pi. It is especially useful if you have your Raspberry Pi publicly accessible via the internet as it is an active and learning form of defense. For those who do not know what Fail2ban is , it is a piece of software that attempts to block malicious connections to your device, which in our case is our Raspberry Pi. It is important if you have SSH or even a web server that is publicly accessible. Fail2ban works by continually scanning your log files and looking for signs of potential attacks. These include attacks such as too many password failures as well as scanning for exploits and much more. Once it finds unusual activity it then automatically updates your firewall to ban that IP address. Equipment You will need the following eq...

Network Printer + Apple AirPrint Server on your Raspberry Pi ******Featured Information********

        On this project, we will be showing you how to set up your Raspberry Pi as an AirPrint server.  AirPrint is a printing protocol designed by Apple so that their devices would not need to download or install drivers. By following this guide, you will be able to add AirPrint functionality to any printer that is connected to your Raspberry Pi. This project is an excellent way of adding extra functionality to both cheap and old printers. Implementing AirPrint support will allow you to print from your Apple device to your connected printer easily. Before following this project, you will need to have first set up the CUPS software on your device. Cups is what will act as the brains of your AirPrint server on your Raspberry Pi. It will handle the communication between your Raspberry Pi and the connected printer.   Equipment List Below are the pieces of equipment that you will need for this tutorial on installing AirPrint on your Raspberry Pi. Recomme...

HiMovies App Policy

   Privacy PolicyYour privacy is important to us. It is HiMovies App Policypolicy to respect your privacy regarding any information we may collect from you across our website, HiMovies App Policyand other sites we own and operate.We only ask for personal information when we truly need it to provide a service to you. We collect it by fair and lawful means, with your knowledge and consent. We also let you know why we’re collecting it and how it will be used.We only retain collected information for as long as necessary to provide you with your requested service. What data we store, we’ll protect within commercially acceptable means to prevent loss and theft, as well as unauthorised access, disclosure, copying, use or modification.We don’t share any personally identifying information publicly or with third-parties, except when required to by law.Our website may link to external sites that are not operated by us. Please be aware that we have no control over the conte...

Most Visited Of the Week

AdGuard Home on your Raspberry Pi

      Equipment Below you can view all of the equipment we used for running AdGuard Home on the Raspberry Pi. Recommended Raspberry Pi Micro SD Card (8GB+) Network Connection Optional Raspberry Pi Case USB Keyboard USB Mouse We tested this tutorial on a Pi 400 running the latest version of Raspberry Pi OS Buster. Installing AdGuard Home to your Raspberry Pi This section will show you how to install the AdGuard home software to your Raspberry Pi. This is a relatively simple process as we can download the compiled version of the ad blocker directly from their website. Before beginning, we highly recommend that you set up your Raspberry Pi with a static IP address. As AdGuard Home works by acting as a DNS server, it must retain the same IP address every time it reboots. 1. Our first step is to update and upgrade our operating system. We can update the package list and upgrade all of the installed packages using the following two commands. sudo apt update sudo apt ful...

Network Printer + Apple AirPrint Server on your Raspberry Pi ******Featured Information********

        On this project, we will be showing you how to set up your Raspberry Pi as an AirPrint server.  AirPrint is a printing protocol designed by Apple so that their devices would not need to download or install drivers. By following this guide, you will be able to add AirPrint functionality to any printer that is connected to your Raspberry Pi. This project is an excellent way of adding extra functionality to both cheap and old printers. Implementing AirPrint support will allow you to print from your Apple device to your connected printer easily. Before following this project, you will need to have first set up the CUPS software on your device. Cups is what will act as the brains of your AirPrint server on your Raspberry Pi. It will handle the communication between your Raspberry Pi and the connected printer.   Equipment List Below are the pieces of equipment that you will need for this tutorial on installing AirPrint on your Raspberry Pi. Recomme...

Raspberry Pi to monitor broadband speed

How to use your Raspberry Pi to monitor broadband speed Step 1: Check for updates As usual, let’s start with checking for the latest updates. Run the following commands in Terminal: sudo apt-get update sudo apt-get upgrade Step 2: Install speedtest-cli There are various methods to measure the speed of broadband connection. We’re going to use speedtest-cli , which, in the words of its creator, is “a command line interface for testing internet bandwidth using speedtest.net.” speedtest-cli isn’t available right away from the Raspbian archives, but we can install it from the Python Package Index (PyPI). That’s easy to do so by using a tool called pip that comes preinstalled on Raspbian Jessie and Stretch. You can make sure that you have pip by running this command: sudo apt-get install python-pip If you a message that reads “python-pip is already the newest version,” that means that we’re good to go. Next, let’s use pip to install speedtest-cli: sudo pip install speedtest-cli...

How to Setup Fail2ban on the Raspberry Pi or use the Pi- Hole setup

    In this Raspberry Pi Fail2ban tutorial, we will be showing you how to set up and configure the Fail2ban software on your Raspberry Pi. Fail2ban is a crucial piece of software when it comes to improving the security of your Raspberry Pi. It is especially useful if you have your Raspberry Pi publicly accessible via the internet as it is an active and learning form of defense. For those who do not know what Fail2ban is , it is a piece of software that attempts to block malicious connections to your device, which in our case is our Raspberry Pi. It is important if you have SSH or even a web server that is publicly accessible. Fail2ban works by continually scanning your log files and looking for signs of potential attacks. These include attacks such as too many password failures as well as scanning for exploits and much more. Once it finds unusual activity it then automatically updates your firewall to ban that IP address. Equipment You will need the following eq...