<p><a href="https://peyanski.com/personal-cloud-from-home-nextcloud-on-raspberry-pi/#Nextcloud_initial_setup" class="uri">https://peyanski.com/personal-cloud-from-home-nextcloud-on-raspberry-pi/#Nextcloud_initial_setup</a></p>
<pre><code>sudo apt-get update &amp;&amp; sudo apt-get upgrade -y</code></pre>
<p>Start the Nextcloud on Raspberry Pi installation with the following script.</p>
<pre><code>curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | sudo bash</code></pre>
<p>Github script content</p>
<p><a href="https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh" class="uri">https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh</a></p>
<pre><code>
#!/bin/bash

# NextCloudPi installation script
#
# Copyleft 2017 by Ignacio Nunez Hernanz &lt;nacho _a_t_ ownyourbits _d_o_t_ com&gt;
# GPL licensed (see end of file) * Use at your own risk!
#
# Usage: ./install.sh
#
# more details at https://ownyourbits.com

BRANCH=master
#DBG=x

set -e$DBG

TMPDIR=&quot;$(mktemp -d /tmp/nextcloudpi.XXXXXX || (echo &quot;Failed to create temp dir.
Exiting&quot; &gt;&amp;2 ; exit 1) )&quot;
trap &quot;rm -rf &quot;${TMPDIR}&quot; ; exit 0&quot; 0 1 2 3 15

[[ ${EUID} -ne 0 ]] &amp;&amp; {
  printf &quot;Must be run as root. Try &#39;sudo $0&#39;n&quot;
  exit 1
}

export PATH=&quot;/usr/local/sbin:/usr/sbin:/sbin:${PATH}&quot;

# check installed software
type mysqld  &amp;&gt;/dev/null &amp;&amp; echo &quot;&gt;&gt;&gt; WARNING: existing mysqld configuration
will be changed &lt;&lt;&lt;&quot;

# get install code
echo &quot;Getting build code...&quot;
apt-get update
apt-get install --no-install-recommends -y wget ca-certificates sudo lsb-release

pushd &quot;$TMPDIR&quot;
wget -qO- --content-disposition
https://github.com/nextcloud/nextcloudpi/archive/&quot;$BRANCH&quot;/latest.tar.gz
  | tar -xz
  || exit 1
cd - &amp;&amp; cd &quot;$TMPDIR&quot;/nextcloudpi-&quot;$BRANCH&quot;

# install NCP
echo -e &quot;nInstalling NextCloudPi...&quot;
source etc/library.sh

# check distro
check_distro etc/ncp.cfg || {
  echo &quot;ERROR: distro not supported:&quot;;
  cat /etc/issue
  exit 1;
}


mkdir -p /usr/local/etc/ncp-config.d/
cp etc/ncp-config.d/nc-nextcloud.cfg /usr/local/etc/ncp-config.d/
cp etc/library.sh /usr/local/etc/
cp etc/ncp.cfg /usr/local/etc/

install_app    lamp.sh
install_app    bin/ncp/CONFIG/nc-nextcloud.sh
run_app_unsafe bin/ncp/CONFIG/nc-nextcloud.sh
systemctl restart mysqld # TODO this shouldn&#39;t be necessary, but somehow it&#39;s
needed in Debian 9.6. Fixme
install_app    ncp.sh
run_app_unsafe bin/ncp/CONFIG/nc-init.sh
bash /usr/local/bin/ncp-provisioning.sh

popd

IFACE=&quot;$( ip r | grep &quot;default via&quot; | awk &#39;{ print $5 }&#39; | head -1 )&quot;
IP=&quot;$( ip a show dev &quot;$IFACE&quot; | grep global | grep -oP &#39;d{1,3}(.d{1,3}){3}&#39; |
head -1 )&quot;

echo &quot;Done.

First: Visit https://$IP/  https://nextcloudpi.local/ (also
https://nextcloudpi.lan/ or https://nextcloudpi/ on windows and mac)
to activate your instance of NC, and save the auto generated passwords. You may
review or reset them
anytime by using nc-admin and nc-passwd.
Second: Type &#39;sudo ncp-config&#39; to further configure NCP, or access ncp-web on
https://$IP:4443/
Note: You will have to add an exception, to bypass your browser warning when you
first load the activation and :4443 pages. You can run letsencrypt to get rid of
the warning if you have a (sub)domain available.
&quot;

exit 0

# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA  02111-1307  USA
</code></pre>
<p>DuckDNS</p>
<p><a href="https://www.duckdns.org" class="uri">https://www.duckdns.org</a></p>
<p>Enter trusted domain</p>
<p><em>NextCloudPi panel</em><br />
<a href="https://hackerpublicradio.org/eps/hpr3259/img_005.png"><img src="https://hackerpublicradio.org/eps/hpr3259/img_005_thumbnail.png" alt="NextCloudPi panel" /></a></p>
<p><em>Trusted domain 1</em><br />
<a href="https://hackerpublicradio.org/eps/hpr3259/img_007.png"><img src="https://hackerpublicradio.org/eps/hpr3259/img_007_thumbnail.png" alt="Trusted domain 1" /></a></p>
<p><em>Trusted domain 2</em><br />
<a href="https://hackerpublicradio.org/eps/hpr3259/img_008.png"><img src="https://hackerpublicradio.org/eps/hpr3259/img_008_thumbnail.png" alt="Trusted domain 2" /></a></p>
<p>Certbot script</p>
<pre><code>sudo apt install certbot python-certbot-apache -y

sudo certbot --apache</code></pre>
<p>Customization External storage support</p>
<p>Apps &gt; Disabled Apps &gt; External Storage Support &gt; Enable</p>
<p><em>Apps 1</em><br />
<a href="https://hackerpublicradio.org/eps/hpr3259/img_001.png"><img src="https://hackerpublicradio.org/eps/hpr3259/img_001_thumbnail.png" alt="Apps 1" /></a></p>
<p><em>Apps 2</em><br />
<a href="https://hackerpublicradio.org/eps/hpr3259/img_002.png"><img src="https://hackerpublicradio.org/eps/hpr3259/img_002_thumbnail.png" alt="Apps 2" /></a></p>
<p><em>Settings</em><br />
<a href="https://hackerpublicradio.org/eps/hpr3259/img_006.png"><img src="https://hackerpublicradio.org/eps/hpr3259/img_006_thumbnail.png" alt="Settings" /></a></p>
<p><em>External storage</em><br />
<a href="https://hackerpublicradio.org/eps/hpr3259/img_004.png"><img src="https://hackerpublicradio.org/eps/hpr3259/img_004_thumbnail.png" alt="External storage" /></a></p>
<p>Dark mode support</p>
<p><em>Apps 3</em><br />
<a href="https://hackerpublicradio.org/eps/hpr3259/img_003.png"><img src="https://hackerpublicradio.org/eps/hpr3259/img_003_thumbnail.png" alt="Apps 3" /></a></p>
