2025 Guide to your own cloud on a Raspberry Pi 5!

3 min read 25 days ago
Published on Jun 22, 2025 This response is partially generated with the help of AI. It may contain inaccuracies.

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

  1. 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
      
  2. 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
      
  3. Verify Docker Installation

    • After rebooting, check your user group:
      groups
      
    • Test Docker by running:
      docker run hello-world
      

Step 2: Install Portainer

  1. Pull Portainer Image

    • Execute the following command to download the Portainer image:
      docker pull portainer/portainer-ce:latest
      
  2. Create Portainer Data Volume

    • Create a volume for Portainer data:
      docker volume create portainer_data
      
  3. 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.
  4. Access Portainer

    • Check your Raspberry Pi's IP address:
      ifconfig
      
    • Open a browser and navigate to https://your_ip_address:9443.

Step 3: Configure Portainer

  1. Set Up Admin Account

    • Create your Portainer admin username and password. Make sure to write these down.
  2. 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'.
  3. Access NextCloud Template

    • Click on 'Templates' on the left-hand side and type 'Next' in the search box.
    • Select 'Nextcloud' to add its container.
  4. 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 is nextcloud_db.
    • Choose a port number different from 9443 (e.g., 5443) for NextCloud.
  5. Deploy NextCloud

    • Click 'Deploy this stack'.
    • Open another browser window and navigate to https://your_ip_address:5443.

Step 4: Set Up NextCloud Admin

  1. Create Admin Account

    • Set an admin username and password for NextCloud. Record these credentials.
  2. 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
  3. 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!