Files Not Showing Up in Nextcloud That Are Uploaded to Local Drive

For this projection, we will be showing you how to setup and configure a Raspberry Pi NextCloud Server. This server can act as your own personal "cloud" storage arrangement.

Raspberry Pi Nextcloud Server

As time goes on the protection of your ain privacy with 3rd party companies becomes harder and harder. This is where software similar Nextcloud comes in manus, as information technology gives you full control over your files with no 3rd party controller.

It is important to remember that since your data will be stored on your local network you volition cease up using a lot of bandwidth when uploading and downloading files from outside your local network. If your cyberspace connection is non great then you lot may not get the best experience if yous plan on using it exterior your local network.

If this looks familiar then that'south because it probable is, Nextcloud is an actively maintained fork of the owncloud software that I take previously covered. The longer information technology's in development the more than unlike these two software packages volition likely go, I suggest looking into both so deciding on which i to go with.

If you want to learn more about Nextcloud, you can check out the nextcloud website.

Notation: The USB ports on a Raspberry Pi are typically unable to power an external hard drive. If you observe this the instance and your hard bulldoze doesn't use an external ability supply then I recommend looking into buying a powered USB hub for the Pi.

Equipment Listing

Yous tin find all the bits and pieces that I used/recommend for this Raspberry Pi Nextcloud tutorial right beneath.

Recommended

Optional

  • Raspberry Pi Example
  • USB Keyboard
  • USB Mouse

Table of Contents

We recommend starting from the first topic and working through each in chronological order. However, if you lot demand, you can skip to a specific topic if required.

  • Installing Apache and PHP
  • Setting upward a MySQL Database and User
  • Downloading Nextcloud
  • Configuring Apache for Nextcloud
  • Nextcloud Initial Setup
  • Moving Nextcloud's Data Folder
  • Increasing Nextcloud's Max Upload Size
  • Setting upwards SSL for Nextcloud
  • Port Forwarding Nextcloud

Installing Apache and PHP

To run Nextcloud on the Raspberry Pi we will first need to install and setup Apache and PHP.

We won't exist going too in-depth into installing these as they are a minor components to this tutorial.

If yous want to learn more about setting upwardly a Web Server, then exist sure to follow our tutorial on how to do this.

For the best functioning I recommend using Raspbian lite but just normal Raspbian will also work just as well.

If you need data on how to set this all upwardly check out the guide in the Pi operating systems section.

For this tutorial, nosotros volition make employ of the latest bachelor version of PHP 8.

1. To get started let's first update our packet repositories with the post-obit command:

              

2. With that done, let's now install apache with the following command:

              

You can check to make sure Apache2 is successfully up and running by going to your Pi's IP address, this should load a default Apache Page.

If you are unsure on what your Raspberry Pi's local IP accost is so blazon in hostname -I into the terminal.

3. With Apache2 now installed onto the Raspberry Pi, we just need to install PHP and several of its packages.

For this tutorial, we volition be using PHP eight.0. This version of PHP is available on Raspberry Pi OS Bullseye. You can either upgrade to Raspberry Pi OS Bullseye or add together a third-political party PHP repository.

To install PHP and the packages we need, run the post-obit control.

              

4. With Apache and PHP now installed there is 1 last affair nosotros demand to do, and that is to restart Apache.

Yous can practice this now making use of the following command:

              

Setting up a MySQL Database and User for Nextcloud

In this section we will be showing you lot how to gear up upwards a user and database for Nextcloud to use to shop its data.

Before beginning this section you must have set up a MySQL server on your Raspberry Pi already.

one. The kickoff thing nosotros demand to do is open the MySQL control line tool past running the following command.

Nosotros will exist using this command line tool to create a user and database for MySQL.

              

2. In one case you take logged in to the tool, we tin start by creating a database.

We volition be creating this database called nextclouddb by running the following command.

              

3. Our next step is to create a user that nosotros will be using to interact with our new database.

We will exist creating a user chosen nextclouduser past running the control below. Make sure that you replace [Password] with a secure countersign and brand note of it for later.

              

4. With our user created nosotros need to at present give it permissions to interact with our database.

Nosotros can do that by running the post-obit command.

              

This control grants the user nextclouduser all privileges on the nextclouddb database and all of its tables.

five. Our concluding job is to affluent the privilege tabular array.

To affluent the privileges all we demand to do is run the following command.

              

With this washed, we can at present continue to install Nextcloud on our Raspberry Pi.

Downloading Nextcloud on your Raspberry Pi

Getting Nextcloud on your the Raspberry Pi is quite unproblematic, it mainly involves downloading the zip file from their website, extracting it and and so making some .

one. To get started let's first movement to our html directory with the following change directory command.

              

2. Now we can download the latest version of Nextcloud to our device.

To exercise this we will use wget to download the latest release to the electric current folder.

              

iii. With Nextcloud at present downloaded to our Raspberry Pi, let us extract the archive.

To extract the archive using tar we need to use the control beneath.

              

4. Nosotros now need to create a data directory for Nextcloud to operate in, for the initial setup of Nextcloud we must make this folder in our html/nextcloud directory.

Create the directory by using the following command:

              

v. Now permit's requite the right user and group control over the entire Nextcloud folder and everything inside information technology by running the following chown command.

              

6. Finally we demand to give it the right permissions, again run the post-obit chmod control.

              

Configuring Apache for Nextcloud

Next, we demand to deal with the .htaccess file for Nextcloud.

Since we installed Nextcloud into the default Apache2 directory /var/www/, we will demand to change some settings in Apache2 to allow the .htaccess file to override settings.

To handle this but for the Nextcloud directory we volition be creating a new configuration file.

1. To get started let'southward create a file which will store our configuration changes for Nextcloud:

              

2. Within this file enter the following lines.

              

These lines basically tell Apache2 how to handle itself inside the /var/world wide web/nextcloud/ folder.

These changes will permit Apache2 to read and utilize the .htaccess files within the Nextcloud directory.

iii. Now we can relieve and quit out of the file by pressing CTRL + 10 then pressing Y and so ENTER.

4. With the file created nosotros now need to tell Apache to brand apply of it.

Nosotros can do this past utilizing the a2ensite command followed by nextcloud.conf.

              

5. Now we need to restart Apache2 to force it to read in the updated configuration file. We can do that easily with the following command:

              

With that washed you lot can at present move on to setting up the Nextcloud software within its web interface.

Nextcloud Initial Setup

1. Now that we have finished with that we tin now finally go to Nextcloud itself and begin its installation procedure.

To begin go to your Raspberry Pi's IP address plus /nextcloud.

If y'all don't know your Raspberry Pi's IP address you can make apply of the command hostname -I.

Recollect to replace [IPADDRESS] with that of your Raspberry Pi's.

              

2. You will now exist greeted with the following screen.

Here you volition need to type in the Username and Password (1.) that you lot intend to use for your admin account.

If you programme on allowing your Nextcloud file service to exist attainable from outside your network, make certain that you use a long and secure password.

Next, nosotros demand to specify the details for our database server. To get to these options you will need to click the "Storage & Datbase" choice (two.).

Now you need to slect the blazon of database we desire to use. As we are using an SQL server click the "MySQL/MariaDB" (3.) pick.

Finally nosotros need to enter the details for our database server. There are three bits of data that we volition demand to enter.

  1. The username for the user that will interact with our database server. (A.) If yous are using the same information we used, this setting should exist gear up to nextclouduser.
  2. The countersign that you set for the above user. (B.)
  3. The last option y'all will need to set is the database proper name. (C.) If you have been following our guide this will be nextclouddb.

Once you lot are happy with this, press the "Cease Setup" button (4.), please note this can take some time to consummate as it finalises your setup.

Raspberry Pi Nextcloud Set up Screen

3. Afterwards this you should now be greeted with the following welcome screen, this just lays out the various programs you tin utilise to connect with your Nextcloud installation.

Just click the X button in the meridian right corner to continue.

Nextcloud Welcome Screen

iv. Now you tin finally see the interface of the Raspberry Pi Nextcloud, you should take some time to familiarize yourself with all the functionality of Nextcloud's interface.

We won't get too in depth on how to employ the Nextcloud interface, if you need more data and then I recommend checking out the support section on nextcloud.

Nosotros have yet highlighted some of the primal areas to check out in the screenshot below.

Nextcloud Files Screen

Moving Nextcloud'south Information Folder

With Nextcloud now safely installed we tin now tweak the setup to both exist more secure and a bit more than useable. One of the get-go things we should practise is move the information directory then information technology does not sit in our web attainable directory.

This is also the same way you would move your Nextcloud information directory onto a larger external difficult bulldoze rather than putting increased load onto the Raspberry Pi's SD Card.

1. To become started permit's make our new directory for where we volition store our information files.

To make it easy nosotros will brand a new folder at /var/nextcloud and move our data folder into there.

Create the folder by running the following command:

              

2. With our new folder we created we will now movement our data directory into it, this is easy to do thanks to the mv command.

Delight annotation that your Nextcloud system will be out of action while we move the file then adjust the configuration file.

To begin the move type in the following control:

              

iii. Now with the files moved over we can now modify the datadirectory configuration to bespeak to our new directory.

First, permit's change to the config directory for Nextcloud with the post-obit command.

              

4. We can at present copy the config file to brand a backup of the file, we can exercise this with the following command:

              

5. Finally let's open up the config.php file for editing using nano.

              

half-dozen. Within this file we need to modify the following line:

              

To

              

7. At present nosotros can save and quit out of the file past pressing CTRL + Ten then Y and then ENTER.

8. Equally one last precuation we should brand sure that the www-data user all the same has ownerships over our new folder.

              

You should exist able to at present refresh your web browser and all your files should be showing exactly as they were previously.

Increasing Nextcloud'southward Max Upload Size

By default, PHP has a very low upload limit, and then low it'south only 2 MB. To change this, we demand to modify the php.ini file and increment the limit. A cloud storage system wouldn't be very useful if you could only ever upload 2mb files.

1. To get started we need to brainstorm editing the configuration file with the following control:

              

2. At present we demand to notice and replace the following two lines.

              

To

              

Of course, you can set the file size limits to something that is much higher than 20M, so experience free to alter that number to any you lot think is the maximum size file you volition upload to your Nextcloud.

3. At present nosotros tin save and quit out of the file by pressing CTRL + X then pressing Y and so ENTER.

At present nosotros need to restart Apache2 to forcefulness it to read in the updated configuration file. We can do that easily with the following command:

              

iv. You should now exist able to restart your spider web browser and begin a new upload to see that the maximum upload size has been increased successfully.

Setting up SSL for Nextcloud

At present we should really work on setting upwards your Raspberry Pi Nextcloud server then that it runs through HTTPS and non patently HTTP.

For this tutorial, we will presume that you exercise non have a domain proper name, so we will exist generating our own self signed certificate and not utilizing one from a free service such as Letsencrypt.

one. Before we become modifying our Apache2 configuration we volition first generate the self-signed document, luckily, we can exercise this all in one command thank you to OpenSSL.

Remember that a self-signed document will throw errors in your web browser and is non every bit secure every bit a properly signed document but information technology is better than nothing. It is also the only pick if y'all're non utilizing a domain name.

Before nosotros generate the document, permit's outset brand a directory to store it.

              

2. Now let's generate the certificate itself past running the following control in the terminal:

              

If you want to know exactly what these command arguments do, and so read our little description beneath.

req: This specifies a subcommand for X.509 certificate signing asking (CSR) management.

-x509: This choice specifies that we want to make a self-signed certificate file instead of generating a certificate asking.

-nodes: This tells the openssl application that we don't desire to specify a passphrase, a passphrase will crave us to enter it every time Apache is restarted which is painful to deal with.

-days 365: This specifies the amount of days nosotros want the certificate to remain valid for, after this amount of days you volition have to generate a new certificate.

-newkey rsa:4096: This will create the certificate asking and a new private cardinal at the same fourth dimension. You will need to do this since we didn't create a individual key in accelerate. The rsa:2048 tells OpenSSL to generate an RSA cardinal that is 2048 bits long.

-keyout: This parameter names the output file for the private key file that is being created.

-out: This pick names the output file for the document that we are generating.

After pressing enter you volition exist presented with the following options to make full out.

              

3. Once yous accept filled out all that data we can then proceed on with setting up Apache2 to run SSL and to likewise employ our newly generated certificate. This is a uncomplicated process but an important one.

First let's enable the SSL module for Apache with the following control:

              

4. At present nosotros need to modify the default-ssl.conf file so it volition utilize our new certificates and not the default ones that are generated by OpenSSL on installation.

To begin modifying this file run the following command:

              

five. Inside this file we need to change the two lines below to point to our new certificates we generated into our /etc/apache2/ssl binder.

Modify

              

To

              

half-dozen. Now we tin save and quit out of the file by pressing CTRL + 10 so pressing Y and and then Enter.

7. We can at present enable the default-ssl configuration and restart Apache to load in our new configuration. We tin can do this with the post-obit ii commands.

              

eight. Yous tin can test to make sure this is working by going to your Raspberry Pi's IP accost with https:// in front of it. Information technology will requite y'all a warning about it potentially being an invalid certificate. This is normal every bit it is an unsigned certificate.

For instance to make sure my own re-create of Nextcloud is now running behind SSL I would become to the post-obit.

              

Steps 9, 10, 11 and 12 are all optional and don't need to be completed.

nine. An optional extra step to ensure that yous have the best security for your Nextcloud setup is to enforce SSL so no connection tin exist fabricated over HTTP, if a connection is made it will redirect you lot to HTTPS.

We tin can do this by making some changes to our apache configuration, to begin let's edit the default file with the following control:

              

10. Replace all the text in this file with the lawmaking below. This will basically redirect all HTTP traffic to its HTTPs equivalent.

              

11. Now we can relieve and quit out of the file by pressing CTRL + X and then pressing Y and then ENTER.

12. Now before this volition work we need to enable the redirect module and restart apache. We can easily achieve this by running the following two commands:

              

At present going to your Raspberry Pi on HTTP should automatically redirect to the HTTPS version. For instance, if I become to http://192.168.one.105 it will redirect to https://192.168.i.105

Port Forwarding Nextcloud

Finally, onto the section about port forwarding Nextcloud. We won't go into as well much depth on the ins and outs of port forwarding for your router merely we volition tell y'all what ports demand forwarding. Nosotros will likewise mention what changes demand to be made to Nextcloud for this to work.

Before we go started with this section you need to know that Nextcloud will only operate under specifically specified trusted domains. Which means you will need to either specify a domain proper noun that you lot want to use for your connection or use your public IP address.

Since most home public IP addresses are dynamic y'all will need to wait into setting up a dynamic DNS service, you volition observe our tutorial on how to setup a dynamic DNS service for your Raspberry Pi very handy.

1. To add together your domain/IP we need to modify NextCloud's configuration file, nosotros can do that by running the following command:

              

two. Inside this file you will see a block of text like below. This is an assortment of all trusted domains that you allow Nextcloud to operate through.

For now, it should only include your Raspberry Pi'due south local IP accost. We will add our new domain/IP onto the end of this assortment.

              

For our example, nosotros will be adding nextcloud.pimylifeup.com to the array. This ways nosotros need to increase the assortment ID and add together the domain name. One time you accept added a new i it should look something like below. Repeat this procedure for any new IP's or domains yous desire Nextcloud to exist able to operate through.

              

3. Now nosotros tin save and quit out of the file by pressing CTRL + X then pressing Y and then ENTER.

four. Finally you lot will need to port forwards two ports to finally take Nextcloud up and running. These 2 ports existence Port 80 and Port 443. The protocol required for these is TCP.

Hopefully by now yous should accept a fully operational Raspberry Pi Nextcloud Server.

If you come across any issues or have some feedback related to this tutorial, then please don't hesitate to leave a comment below.

kellythismillond.blogspot.com

Source: https://pimylifeup.com/raspberry-pi-nextcloud-server/

Belum ada Komentar untuk "Files Not Showing Up in Nextcloud That Are Uploaded to Local Drive"

Posting Komentar

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel