<p><ahref="https://nextcloud.com"target="_blank"><imgsrc="pix/nextcloud.svg"alt="logo">Nextcloud</a> is a free and open source solution for cloud storage. However it can also do other things, such as manage your email, notes, calender, tasks, and can even connect to the Fediverse (think Mastodon and Pleroma). Pretty much every service that Google has to offer has a much better alternative as a Nextcloud app and this is a must-have for anyone wanting to get away from Google services but still wants a traditional cloud experience (in the likes of Google Services, anyways).</p>
<p>First, we need to obtain a shell prompt by ssh-ing (remote machines or local machines) or just logging in (local machines). A traditional ssh might look like this if the domain you wished to ssh into is <code>landchad.net</code>:</p>
<p>Next, we need to set up our SQL database by running a Secure Installation and creating the tables that will store data that Nextcloud will need. Run the following command:</p>
<p>When it asks for root a password, say yes and input a new and secure password. The root password here is just for the SQL database, not for the GNU/Linux system.</p>
<p>Answer the rest of the questions as follows:</p>
<p>Now we need to configure PHP. Let's start my making sure that the PHP user is set to <code>www-data</code> and if that is not the case, add the <code>www-data</code> user if needed and set the correct variable in <code>nginx.conf</code>. Make sure this line is at the beginning of <code>/etc/nginx/nginx.conf</code>.</p>
<pre><code>user www-data;</code></pre>
<p>Check for the <code>www-data</code> user by running <code>id -u www-data</code>. If a number is output from that command, then the www-data user exists. If not. add the user simply by running <code>useradd www-data</code></p>
<p>Next, we need to ensure that we have SSL certificates generated for your website. If you have not already done this, refer to <ahref="certbot.html">this guide</a>. Although having SSL for your site is not required, it is highly recommended that you have it or you will risk attackers being able to steal passwords and data.</p>
<p>In <code>/etc/nginx/sites-available/</code> we need to make a new configuration for Nextcloud (example: <code>/etc/nginx/sites-available/nextcloud</code>). Create it and open it, modify, and add the following lines:</p>
<pre><code>server {
listen 80;
listen [::]:80;
server_name <strong>yourwebsite.com</strong>;
location /nextcloud {
return 301 https://$server_name$request_uri;
}
}
server {
<strong># If you have SSL ready for your website (DO NOT use Nextcloud without HTTPS, you will risk data leaks including passwords and files), use these lines:</strong>
<p>Next, we need to download the latest release tarball of Nextcloud. Go to <a>https://nextcloud.com/install/#instructions-server</a> and copy the URL of the the .tar.bz2 tarball from the More Downloads dropdown menu then go to your server's shell prompt and download the tarball with wget. Here is an example:</p>
<p>Start and enable the php-fpm and the mariadb services (the name of the php-fpm service may have a version number ahead of it, use bash's tab autocomplete to help you out with that):</p>
<p>Now we need to head to Nextcloud's web interface. Go to your web browser and go to your website, but go to the subdirectory "nextcloud" instead. For example, if your domain is landchad.net and you have set up HTTPS then go to <code>https://landchad.net/nextcloud</code>. This will launch the configuration wizard.</p>
<footer><ahref="https://landchad.net">LandChad.net</a></br>Because Everyone should be an Internet LandChad.</br><li><ahref="index.html"><imgsrc="pix/chad.gif"alt="chad"></a></li><li><ahref="rss.xml"><imgsrc="pix/rss.svg"alt="RSS"></a></li><li><ahref="pix/btc.png"><imgsrc="pix/btc.svg"alt="BTC"></a></li><li><ahref="pix/xmr.png"><imgsrc="pix/xmr.svg"alt="XMR"></a></li><li><ahref="https://github.com/lukesmithxyz/landchad"><imgsrc="pix/git.svg"alt="Github"></a></footer>