Setup a Raspberry Pi Cloud Server With Nextcloud

A short while back I created my own home server which, among other things, used Nextcloud to act as a private cloud server to hold all my important documents and synchronise them across my devices.

It’s working really well, but what if you didn’t want to have a great hulking PC running in your house 24/7?

Raspberry Pi to the rescue once again. These single-board computers are a great way to accomplish simple computer tasks without taking up a lot of space or spanking your electric meter. In this guide I’ll show you how to use a Raspberry Pi to setup your own private cloud server.

You will need….

  • A Raspberry Pi 3 single board computer
  • A 16GB Micro-SD card
  • A USB power supply
  • A keyboard, mouse and monitor to configure the Pi
  • An Internet connection
  • An Ethernet cable
  • A USB hard disk

Setting up your Raspberry Pi

I’m not going to replicate the excellent work already done by the Raspbery Pi Foundation demonstrating how to setup a Raspberry Pi with the default OS. You can find out how to do that here.

Once the software is installed there’s a couple of other things we want to do.

First you’re going to want to set a static IP address on your Pi so that other devices on your network know where to look for Nextcloud.

To do this open a Terminal window and type the following:

sudo nano /etc/dhcpcd.conf

This will open the networking configuration file. Use the cursor keys to move to the bottom of the file and then paste the following lines in, changing the IP details for ones that suit your network:

interface eth0

static ip_address=
static routers=
static domain_name_servers=  

Press ctrl+O to save, then ctrl+x to exit the file.

Reboot your Raspberry Pi and you should find it retains the IP address you’ve set. Make a note of this address as you’ll need it later on.

Setting up Apache and PHP

In order to install Nextcloud we need to setup a few other things first, namely Apache and PHP.

The first step on any Linux project should be to make sure our OS is up to date, so open a Terminal window and run the following two commands:

sudo apt-get update
sudo apt-get upgrade

Type “Y” at any prompts given, this will install the latest software updates to your Pi.

Next you’ll need to install Apache:

sudo apt-get install apache2

Once this is installed you’ll need to install PHP:

sudo apt-get install php7.3 php7.3-gd sqlite php7.3-sqlite3 php7.3-curl php7.3-zip php7.3-xml php7.3-mbstring

Once that has installed you’ll need to restart the Apache service:

sudo service apache2 restart

2 thoughts on “Setup a Raspberry Pi Cloud Server With Nextcloud”

  1. Matt, thanks for the very complete and useful guide. Yours is the best one I’ve found when looking for help with installing nextcloud on my local server.

Leave a Reply