2025 Guide to your own cloud on a Raspberry Pi 5!
Table of Contents
Introduction
In this tutorial, we'll guide you through the process of setting up your personal cloud storage using NextCloud on a Raspberry Pi 5, all within a Docker container managed by Portainer. This setup allows you to host your files, documents, and media without paying monthly fees, empowering you with control over your data. NextCloud is open-source and offers various applications for office work, media management, and email access.
Step 1: Prepare Your Raspberry Pi
-
Update Raspberry Pi OS
- Make sure your Raspberry Pi OS is up to date. Open a terminal and run:
sudo apt update && sudo apt upgrade -y
- Make sure your Raspberry Pi OS is up to date. Open a terminal and run:
-
Install Docker
- Use the following command to install Docker:
curl -sSL https://get.docker.com | sh
- After installation, add your user to the Docker group:
sudo usermod -aG docker $USER
- Reboot your Raspberry Pi:
sudo reboot
- Use the following command to install Docker:
-
Verify Docker Installation
- After rebooting, check your user group:
groups
- Test Docker by running:
docker run hello-world
- After rebooting, check your user group:
Step 2: Install Portainer
-
Pull Portainer Image
- Execute the following command to download the Portainer image:
docker pull portainer/portainer-ce:latest
- Execute the following command to download the Portainer image:
-
Create Portainer Data Volume
- Create a volume for Portainer data:
docker volume create portainer_data
- Create a volume for Portainer data:
-
Run Portainer Container
- Run the Portainer container with the following command:
docker run -d -p 8000:8000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
- This command ensures Portainer restarts with the Raspberry Pi and uses the specified ports.
- Run the Portainer container with the following command:
-
Access Portainer
- Check your Raspberry Pi's IP address:
ifconfig
- Open a browser and navigate to
https://your_ip_address:9443
.
- Check your Raspberry Pi's IP address:
Step 3: Configure Portainer
-
Set Up Admin Account
- Create your Portainer admin username and password. Make sure to write these down.
-
Update App Template URL
- Click on 'Settings' in the lower left corner.
- Paste the following URL into the app template URL box:
https://raw.githubusercontent.com/TomChantler/portainer-templates/refs/heads/v3/templates_v3.json
- Click 'Save'.
-
Access NextCloud Template
- Click on 'Templates' on the left-hand side and type 'Next' in the search box.
- Select 'Nextcloud' to add its container.
-
Configure NextCloud Settings
- Enter your timezone in the format
Country/City
(e.g.,England/London
). - Set a password for the database and MariaDB. Write these down.
- The database user should be
nextcloud
, and the database name isnextcloud_db
. - Choose a port number different from 9443 (e.g., 5443) for NextCloud.
- Enter your timezone in the format
-
Deploy NextCloud
- Click 'Deploy this stack'.
- Open another browser window and navigate to
https://your_ip_address:5443
.
Step 4: Set Up NextCloud Admin
-
Create Admin Account
- Set an admin username and password for NextCloud. Record these credentials.
-
Configure Database Settings
- Select 'MySQL/MariaDB' for your database.
- Database Account:
nextcloud
- Password: Enter the password you set in Portainer.
- Database Name:
nextcloud_db
- Database Host:
nextcloud_db:3306
-
Complete Installation
- Click 'Install' to finalize the setup.
- You should see the NextCloud welcome screen upon successful installation.
Conclusion
Congratulations! You have successfully set up your personal cloud storage using NextCloud on a Raspberry Pi 5 with Docker and Portainer. This setup not only provides you with a secure way to manage your files but also offers a customizable platform for future applications.
Next steps could include exploring additional NextCloud applications or enhancing security settings. Enjoy your self-hosted cloud!