Launch Personal Document Sharing

Launch Personal Document Sharing

This tutorial will guide you through setting up a personal document sharing service using Nextcloud, an open-source file synchronization and sharing application. This is ideal for developers and homelab enthusiasts who want to host their own file-sharing solution.

Hardware or Software Requirements

Step-by-Step Instructions

    • Install a Linux distribution on your server. For this example, we will use Ubuntu 20.04 LTS.

  1. Update the system and install necessary packages:

      • sudo apt update && sudo apt upgrade -y
      • sudo apt install software-properties-common -y
      • sudo add-apt-repository ppa:nextcloud-devs/ppa -y
      • sudo apt update
  2. Install Apache, PHP, and MySQL:

      • sudo apt install apache2 php libapache2-mod-php mysql-server php-mysql -y
  3. Create a database for Nextcloud:

      • sudo mysql -u root -p
      • CREATE DATABASE nextcloud;
      • GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'yourpassword';
      • FLUSH PRIVILEGES;
      • EXIT;
  4. Download and extract Nextcloud:

      • cd /var/www/html
      • wget https://download.nextcloud.com/server/releases/nextcloud-23.0.1.zip
      • unzip nextcloud-23.0.1.zip
      • mv nextcloud nextcloud-app
  5. Configure Apache:

      • Edit /etc/apache2/sites-available/000-default.conf:
    • Add the following lines inside the <VirtualHost *:80> block:
      <Directory /var/www/html/nextcloud-app/>
          AllowOverride All
      </Directory>
      
      • a2enmod rewrite
      • sudo systemctl restart apache2
    • Access Nextcloud via web browser at http://yourserverip. Follow the on-screen instructions to complete the setup, including setting up a database connection and creating an admin account.

  6. (Optional) Set up SSL:

    • Install Certbot and Apache plugin:
      sudo apt install certbot python3-certbot-apache -y
      
    • Obtain a certificate:
      sudo certbot --apache
      

Commands Where Useful

Troubleshooting Section

Conclusion

You now have a personal document sharing service up and running using Nextcloud. This setup provides a secure and flexible way to share files with others, making it suitable for both personal use and small teams. Explore additional features in the Nextcloud documentation to further customize your installation.

Comments