Making a nextcloud server on old laptop with personal domain

How do I set up a next cloud server/cloud on an old laptop and access it from my personal domain? I am brand new to next cloud and have seen some things about turning old laptops into nextcloud servers. The idea of having 500 gigs of server storage sounds awesome. I already have a domain name. My dream would be to have my old laptop store everything and be a cloud while doing weekly backups to an external hard drive. Is this possible?
Thanks!

technically yes. You need to open the ports on your router and point your domain to it. Should by a DynDNS provider to avoid that it changes.

But be aware that the speed highly depends on your internet connection. Especially if you’re on an asynchronius line, it can be slow.

Be also aware that there is always a risk if you open your LAN to the Internet.
If you really unsure about it, a cheap cloud provider might be a better solution for you

1 Like

Hi, that is possible. As a recommendation you can try to check this out:
https://wiki.omv-extras.org/doku.php?id=installing_omv5_i386_32_bit_pc
After installation you can get a docker and run your NC container there together with Nginx and mariaDB.

I hope this helps

why should he install OMV first and then use docker?

Simply install Linux (any flavor) on the device and follow the tons of tutoraials how to get it done.

Just like this after 10 seconds of google:

1 Like

Hi @Jchild25,
there are many tutorials to install nextcloud using a domain name.
there are many types of installation of nextcloud: docker, snap or using “packages ( folder )”.
In my case, I use “packages” with apache2

link to the official doc: Installation and server configuration — Nextcloud latest Administration Manual latest documentation

my steps to install nextcloud on ubuntu 20.04 :

Installation of requirement :

  • sudo apt install apache2 mariadb-server

  • sudo apt-get install php zip libapache2-mod-php php-gd php-json php-mysql php-curl php-mbstring php-intl php-imagick php-xml php-zip php-mysql php-bcmath php-gmp php-apcu -y

  • sudo mysql_secure_installation
    Enter current password for root (enter for none): Just press the Enter
    Set root password? [Y/n]: Y
    New password: Enter your password
    Re-enter new password: Repeat your password
    Remove anonymous users? [Y/n]: Y
    Disallow root login remotely? [Y/n]: Y
    Remove test database and access to it? [Y/n]: Y
    Reload privilege tables now? [Y/n]: Y

  • sudo mysql -u root -p

  • CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

  • CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'user_password_here';

  • GRANT ALL ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'user_password_here' WITH GRANT OPTION;

  • FLUSH PRIVILEGES;

  • EXIT;

/!\ for more security , replace nextcloud │ nextclouduser│user_password_here

Download of nextcloud

  • wget https://download.nextcloud.com/server/releases/nextcloud-21.0.0.zip
  • unzip nextcloud-21.0.0.zip
  • sudo mv nextcloud /var/www/nextcloud/
  • sudo chown -R www-data:www-data /var/www/nextcloud/
  • sudo chmod -R 750 /var/www/nextcloud/

Setting up apache

  • sudo nano /etc/apache2/sites-available/domain.conf ( Change domain by what you want )
<VirtualHost *:80>
DocumentRoot /var/www/nextcloud/
ServerName example.com

 Alias /nextcloud "/var/www/nextcloud/"  

 <Directory /var/www/nextcloud/>
    Options +FollowSymlinks
    AllowOverride All
    Require all granted
      <IfModule mod_dav.c>
        Dav off
      </IfModule>
    SetEnv HOME /var/www/nextcloud
    SetEnv HTTP_HOME /var/www/nextcloud
 </Directory>

 ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Replace example.conf by your domain name
If you want to acces to nextcloud by using only domain.com ( not domain.com/nextcloud/) just delete Alias /nextcloud "/var/www/nextcloud/"

  • ctrl+s
  • ctrl+x
  • sudo a2ensite domain.conf
  • sudo a2enmod rewrite
  • sudo a2enmod env
  • sudo a2enmod dir
  • sudo a2enmod mime
  • sudo systemctl restart apache2

you can access to the wizard installation of nextcloud on your local ip

  • create an admin account

  • set the path of your data directory ( where the data of users are stored ) this directory need to be available by www-data user with full access:
    sudo chown -R www-data:www-data /PathDirectory
    sudo chmod -R 750 /PathDirectory

  • Enter your user database ( in this tutorial , it is nextclouduser)

  • Enter your password user ( in this tutorial , it is user_password_here)

  • Enter your database name ( in this tutorial , it is nextcloud)

launch the installation

Add your domain to trusted domain

  • sudo nano /var/www/nextcloud/config/config.php
  • inside trusted domain add :
    1=> ' domain.com '

Enable ssl ( https connection ) using certbot ( need to open your router port and don’t forget to setup a firewall like ufw or other )

  • sudo apt-get install certbot python3-certbot-apache

  • sudo certbot --apache

  • Enter your mail address , agree the term, select you domain and redirect all traffic to https

  • sudo nano /etc/apache2/sites-available/domain-le-ssl.conf

  • add this line before the last </VirtualHost> :

Header always set Strict-Transport-Security “max-age=15552000; includeSubDomains”

Enable Redis Memcache

  • sudo apt-get install redis-server php-redis
  • sudo nano /var/www/nextcloud/config/config.php
  • add these lines before the last ); :

‘memcache.local’ => ‘\OC\Memcache\Redis’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,
‘memcache.distributed’ => ‘\OC\Memcache\Redis’,
‘redis’ =>
array (
‘host’ => ‘localhost’,
‘port’ => 6379,
),

PHP memory limit and opcache:

  • sudo nano /etc/php/7.4/apache2/php.ini
  • ctrl+w
  • memory
  • set memory_limiteto 512 M
  • find the lines and set the values :
    opcache.enable=1
    opcache.enable_cli=1
    opcache.interned_strings_buffer=8
    opcache.max_accelerated_files=10000
    opcache.memory_consumption=128
    opcache.save_comments=1
    opcache.revalidate_freq=1

PHP fpm :

  • sudo apt-get install php-fpm
  • sudo a2enmod proxy_fcgi setenvif
  • sudo a2enconf php7.4-fpm
  • systemctl restart apache2
  • sudo nano /etc/php/7.4/fpm/pool.d/www.conf
  • find the lines and set the values :
    pm.max_children = 120
    pm.start_servers = 12
    pm.min_spare_servers = 6
    pm.max_spare_servers = 18

link to nextcloud doc for tunning ( Redis / opcache / php fpm / SSL) : Server tuning — Nextcloud latest Administration Manual latest documentation

1 Like