<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Nextcloud &amp;mdash; Kevin Neely&#39;s Security Notes</title>
    <link>https://infosec.press/ktneely/tag:Nextcloud</link>
    <description>A place where I can post security-related long-form thoughts, notes, and articles</description>
    <pubDate>Tue, 14 Apr 2026 14:25:28 +0000</pubDate>
    <item>
      <title>Migrating a hosted Nextcloud instance to your Home Lab</title>
      <link>https://infosec.press/ktneely/migrating-a-hosted-nextcloud-instance-to-your-home-lab</link>
      <description>&lt;![CDATA[I finally decided to move my #NextCloud instance from one that I had been operating on the #Vultr hosting service to my #HomeLab. &#xA;&#xA;A note on Vultr: I am impressed with this service.   I have used them for multiple projects and paid with various means, from credit card to #cryptocurrency for about 10 years and I cannot even remember a downtime that impacted me.  (In fact, I think there was only one real downtime, which was planned, well-communicated, and didn’t impact me because my setup was fairly resilient).  With a growing volume of data, and sufficient spare hardware that wasn’t doing anything, I decided to bring it in-house. &#xA;&#xA;This is not going to be a full guide, as there are plenty of those, but I did run into some hurdles that may be common, especially if a pre-built Nextcloud instance was used.   So this is meant to provide some color and augment the official and popular documentation.&#xA;&#xA;Getting started&#xA;&#xA;Plan out the migration&#xA;&#xA;Migration Overview&#xA;Essentially, there are three high-level steps to this process&#xA;Build a new Nextcloud server in the homelab&#xA;Copy the configuration (1 file), database (1 backup file), apps (install apps), and data (all user files) over to the new system&#xA;Restore all the copied data to the new instance&#xA;&#xA;Preparing to Migrate&#xA;Start with the NextCloud official documentation for migrating to a different server as well as:&#xA;&#x9;Backing up Nextcloud&#xA;&#x9;and the restoring a server doc&#xA;Check out Nicholas Henkey’s migrate Nextcloud to a new server blog post.  This is very thorough and has some great detail if you’re not super familiar with Nextcloud (because you used a pre-built instance)&#xA;For the new build:&#xA;&#x9;A full set of installation instructions, placing [Nextcloud behind an Nginx proxy](https://github.com/jameskimmel/NextcloudUbuntu/blob/main/nextcloudbehindNGINXproxy.md.&#xA;&#x9;An older install document for Installing Nextcloud on Ubuntu with Redis, APCu, SSL &amp; Apache&#xA;&#xA;Migration&#xA;&#xA;While the official documentation describes the basics, the following is the steps I recommend following.  This is at a medium level, providing the details, but not the specific command-line arguments (mostly).&#xA;&#xA;Build the new server&#xA;&#x9;Use your favorite flavor of Linux (I used Debian, and these notes will reflect that)&#xA;&#x9;&#x9;install all updates, &#xA;&#x9;&#x9;install fail2ban or similar security if you’re exposing this to the Internet.&#xA;&#x9;&#x9;name the new system the same as the outgoing server&#xA;&#x9;Download the Nextcloud install from the nextcloud download site  and choose either:&#xA;&#x9;&#x9;update the current system to the latest version of whatever major version your running, and then download latest-XX.tar.bz2 where ‘XX’ is your version&#xA;&#x9;&#x9;identify your exact version and download it from nextcloud&#xA;&#x9;Install the dependencies (mariaDB, redis, php, apache, etc. etc.)&#xA;&#x9;&#x9;note: if the source server is running nginx, I recommend sticking with that for simplicity, keeping in mind that only Apache is officially supported&#xA;&#x9;Unpack Nextcloud&#xA;&#x9;Validate that it’s working&#xA;&#x9;Place it into maintenance mode&#xA;Backup the data&#xA;&#x9;If using multi-factor authentication, find your recovery codes or create new ones &#xA;&#x9;Place the server into maintenance mode&#xA;&#x9;Backup the database&#xA;&#x9;copy the database backup to a temporary location on the new server&#xA;&#xA;Restore the data&#xA;&#x9;Restore the database&#xA;&#x9;copy /path/to/nextcloud/config/config.php over the existing config.php&#xA;&#x9;rsync the data/ directory to the new server  &#xA;&#x9;&#x9;you can remove old logs in the data directory&#xA;&#x9;&#x9;you may need to use an intermediary step, like a USB drive.  It’s best if this is ext4 formatted so you can retain attributes&#xA;&#x9;&#x9;the rsync options should include -Aaxr  you may want -v and/or --progress to get a better feel for what’s going on&#xA;&#x9;&#x9;if rsync-ing over ssh, the switch is -e ssh&#xA;&#x9;If you have installed any additional apps for your Nextcloud environment, rsync the apps/ directory in the same way as the data dir above&#xA;&#x9;Validate the permissions in your nextcloud, data, and apps directories.   Fix as necessary, see the info Nicholas Henkey’s post (linked above) for commands&#xA;&#x9;Redirect your A or CNAME record to the new system&#xA;&#x9;Configure SSL on the new system&#xA;&#x9;Turn off maintenance mode&#xA;&#x9;Log in and test!   :fingers-crossed:&#xA;&#xA;Troubleshooting&#xA;Hopefully everything is working.  Make sure to check the logs if something is broken.  &#xA;&#xA;log locations&#xA;the nextcloud.log in  the data/ directory&#xA;the apache logs in /var/log/apache2&#xA;the redis logs in /var/log/redis&#xA;the system logs, accessible with journalctl &#xA;&#xA;Reiterating: Remember or check for these items&#xA;These are the specific notes I took as I ran into problems that I had to work around or solve.  These are incorporated in the above, so this is basically a restatement of the gotchas I ran into:&#xA;&#xA;upgrade the current one to the latest version of the current release (i.e. the latest of the major version you are on, so if you were running 29.0.3, get to 29.0.9)&#xA;&#x9;this makes it easier when you download version-latest.tar.bz2&#xA;&#x9;If you’d prefer to skip that, use the nextcloud download site with all available versions.  Make sure to grab the same one and compare the specific version as listed in config.php.   Example: &#39;version&#39; =  &#39;29.0.9.2&#39;,&#xA;use the same name on the new server&#xA;use the same web server.  Apache is officially supported, but if you’re using nginx, it will be easier to stay on that.&#xA;Most multi-factor authentication, like WebAuthN, FIDO hardware keys, etc. will not work over HTTP in the clear.&#xA;&#x9;IOW: make sure you have recovery codes&#xA;If the apps aren’t copied over, the new server sees them as installed rather than installable.  I suppose one could “delete” or remove them in the admin GUI and then reinstall, but otherwise, there was no button to force a reinstall.&#xA;Files and data you need to copy over after creating the install.  Do each of these separately, rather&#xA;&#x9;if you have any additional apps, copy the apps/ directory over&#xA;&#x9;copy config.php&#xA;&#x9;copy the data/ directory  &#xA;Is your current install using Redis-based transactional file locking?  &#xA;&#x9;If the previous system was using Redis and it is still in the configuration, the new system will not be able to obtain file-locking and essentially all users will be read-only and not able to modify or create new files.&#xA;&#x9;In config.php, you will see settings such as &#39;redis&#39; and &#39;memcache.locking&#39; =  &#39;\\OC\\Memcache\\Redis&#39;,&#xA;&#x9;make sure Redis is installed on the new system and running on the same port (or change the port in config.php)&#xA;&#x9;Install the necessary software:  apt install redis-server php-redis php-apcu&#xA;&#x9;Ensure that the Redis and APCu settings in config.php are according to the documented single-server settings &#xA;&#xA;The Memcache settings should look something like the following configuration snippet.  Alternatively, you could enable and use the process socket.&#xA;&#xA;&#39;memcache.local&#39; =  &#39;\OC\Memcache\APCu&#39;,&#xA;&#39;memcache.distributed&#39; =  &#39;\OC\Memcache\Redis&#39;,&#xA;&#39;memcache.locking&#39; =  &#39;\OC\Memcache\Redis&#39;,&#xA;&#39;redis&#39; =  [&#xA;     &#39;host&#39; =  &#39;localhost&#39;,&#xA;     &#39;port&#39; =  6379,&#xA;],&#xA;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>I finally decided to move my <a href="/ktneely/tag:NextCloud" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">NextCloud</span></a> instance from one that I had been operating on the <a href="/ktneely/tag:Vultr" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Vultr</span></a> hosting service to my <a href="/ktneely/tag:HomeLab" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">HomeLab</span></a>.</p>

<p>A note on <a href="https://vultr.com" rel="nofollow">Vultr</a>: I am impressed with this service.   I have used them for multiple projects and paid with various means, from credit card to <a href="/ktneely/tag:cryptocurrency" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">cryptocurrency</span></a> for about 10 years and I cannot even remember a downtime that impacted me.  (In fact, I think there was only one real downtime, which was planned, well-communicated, and didn’t impact me because my setup was fairly resilient).  With a growing volume of data, and sufficient spare hardware that wasn’t doing anything, I decided to bring it in-house.</p>

<p>This is not going to be a full guide, as there are plenty of those, but I did run into some hurdles that may be common, especially if a pre-built Nextcloud instance was used.   So this is meant to provide some color and augment the official and popular documentation.</p>

<h2 id="getting-started">Getting started</h2>

<h3 id="plan-out-the-migration">Plan out the migration</h3>

<h4 id="migration-overview">Migration Overview</h4>

<p>Essentially, there are three high-level steps to this process
1. Build a new Nextcloud server in the homelab
2. Copy the configuration (1 file), database (1 backup file), apps (install apps), and data (all user files) over to the new system
3. Restore all the copied data to the new instance</p>

<h4 id="preparing-to-migrate">Preparing to Migrate</h4>
<ol><li>Start with the NextCloud official documentation for <a href="https://docs.nextcloud.com/server/latest/admin_manual/maintenance/migrating.html" rel="nofollow">migrating to a different server</a> as well as:
<ol><li><a href="https://docs.nextcloud.com/server/latest/admin_manual/maintenance/backup.html" rel="nofollow">Backing up Nextcloud</a></li>
<li>and the <a href="https://docs.nextcloud.com/server/latest/admin_manual/maintenance/restore.html" rel="nofollow">restoring a server</a> doc</li></ol></li>
<li>Check out Nicholas Henkey’s <a href="https://nicholas-henkey.com/blog/migrate-nextcloud-to-new-server" rel="nofollow">migrate Nextcloud to a new server</a> blog post.  This is very thorough and has some great detail if you’re not super familiar with Nextcloud (because you used a pre-built instance)</li>
<li>For the new build:
<ol><li>A full set of installation instructions, placing [Nextcloud behind an Nginx proxy](<a href="https://github.com/jameskimmel/Nextcloud_Ubuntu/blob/main/nextcloud_behind_NGINX_proxy.md" rel="nofollow">https://github.com/jameskimmel/Nextcloud_Ubuntu/blob/main/nextcloud_behind_NGINX_proxy.md</a>.</li>
<li>An older install document for <a href="https://bayton.org/docs/nextcloud/installing-nextcloud-on-ubuntu-16-04-lts-with-redis-apcu-ssl-apache" rel="nofollow">Installing Nextcloud on Ubuntu with Redis, APCu, SSL &amp; Apache</a></li></ol></li></ol>

<h2 id="migration">Migration</h2>

<p>While the official documentation describes the basics, the following is the steps I recommend following.  This is at a medium level, providing the details, but not the specific command-line arguments (mostly).</p>
<ol><li><strong>Build the new server</strong>
<ol><li>Use your favorite flavor of Linux (I used Debian, and these notes will reflect that)
<ol><li>install all updates,</li>
<li>install <a href="https://en.wikipedia.org/wiki/Fail2ban" rel="nofollow">fail2ban</a> or similar security if you’re exposing this to the Internet.</li>
<li>name the new system the same as the outgoing server</li></ol></li>
<li>Download the Nextcloud install from the <a href="https://download.nextcloud.com/server/releases/" rel="nofollow">nextcloud download site</a>  and choose either:
<ol><li>update the current system to the latest version of whatever major version your running, and then download <code>latest-XX.tar.bz2</code> where ‘XX’ is your version</li>
<li>identify your exact version and download it from nextcloud</li></ol></li>
<li>Install the dependencies (mariaDB, redis, php, apache, etc. etc.)
<ol><li>note: if the source server is running nginx, I recommend sticking with that for simplicity, keeping in mind that only Apache is officially supported</li></ol></li>
<li>Unpack Nextcloud</li>
<li>Validate that it’s working</li>
<li>Place it into maintenance mode</li></ol></li>

<li><p><strong>Backup the data</strong></p>
<ol><li>If using multi-factor authentication, find your recovery codes or create new ones</li>
<li>Place the server into maintenance mode</li>
<li>Backup the database</li>
<li>copy the database backup to a temporary location on the new server</li></ol></li>

<li><p><strong>Restore the data</strong></p>
<ol><li>Restore the database</li>
<li>copy <code>/path/to/nextcloud/config/config.php</code> over the existing <code>config.php</code></li>
<li><code>rsync</code> the <code>data/</code> directory to the new server<br>
<ol><li>you can remove old logs in the data directory</li>
<li>you may need to use an intermediary step, like a USB drive.  It’s best if this is <code>ext4</code> formatted so you can retain attributes</li>
<li>the <code>rsync</code> options should include <code>-Aaxr</code>  you may want <code>-v</code> and/or <code>--progress</code> to get a better feel for what’s going on</li>
<li>if rsync-ing over ssh, the switch is <code>-e ssh</code></li></ol></li>
<li>If you have installed any additional apps for your Nextcloud environment, rsync the <code>apps/</code> directory in the same way as the data dir above</li>
<li>Validate the permissions in your nextcloud, data, and apps directories.   Fix as necessary, see the info Nicholas Henkey’s post (linked above) for commands</li>
<li>Redirect your A or CNAME record to the new system</li>
<li>Configure SSL on the new system</li>
<li>Turn off maintenance mode</li>
<li>Log in and test!   :fingers-crossed:</li></ol></li></ol>

<h3 id="troubleshooting">Troubleshooting</h3>

<p>Hopefully everything is working.  Make sure to check the logs if something is broken.</p>

<p>log locations
– the <code>nextcloud.log</code> in  the <code>data/</code> directory
– the apache logs in <code>/var/log/apache2</code>
– the redis logs in <code>/var/log/redis</code>
– the system logs, accessible with <code>journalctl</code></p>

<h2 id="reiterating-remember-or-check-for-these-items">Reiterating: Remember or check for these items</h2>

<p>These are the specific notes I took as I ran into problems that I had to work around or solve.  These are incorporated in the above, so this is basically a restatement of the gotchas I ran into:</p>
<ul><li>upgrade the current one to the latest version of the current release (i.e. the latest of the major version you are on, so if you were running 29.0.3, get to 29.0.9)
<ul><li>this makes it easier when you download <code>&lt;version&gt;-latest.tar.bz2</code></li>
<li>If you’d prefer to skip that, use the <a href="https://download.nextcloud.com/server/releases/" rel="nofollow">nextcloud download site</a> with all available versions.  Make sure to grab the same one and compare the specific version as listed in <code>config.php</code>.   Example: <code>&#39;version&#39; =&gt; &#39;29.0.9.2&#39;,</code></li></ul></li>
<li>use the same name on the new server</li>
<li>use the same web server.  Apache is officially supported, but if you’re using nginx, it will be easier to stay on that.</li>
<li>Most multi-factor authentication, like WebAuthN, FIDO hardware keys, etc. will not work over HTTP in the clear.
<ul><li>IOW: make sure you have recovery codes</li></ul></li>
<li>If the apps aren’t copied over, the new server sees them as installed rather than installable.  I suppose one could “delete” or remove them in the admin GUI and then reinstall, but otherwise, there was no button to force a reinstall.</li>
<li>Files and data you need to copy over after creating the install.  Do each of these separately, rather
<ul><li>if you have any additional apps, copy the <code>apps/</code> directory over</li>
<li>copy <code>config.php</code></li>
<li>copy the <code>data/</code> directory<br></li></ul></li>
<li>Is your current install using <a href="https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#using-redis-based-transactional-file-locking" rel="nofollow">Redis-based transactional file locking</a>?<br>
<ul><li>If the previous system was using Redis and it is still in the configuration, the new system will not be able to obtain file-locking and essentially all users will be read-only and not able to modify or create new files.</li>
<li>In <code>config.php</code>, you will see settings such as <code>&#39;redis&#39;</code> and <code>&#39;memcache.locking&#39; =&gt; &#39;\\OC\\Memcache\\Redis&#39;,</code></li>
<li>make sure Redis is installed on the new system and running on the same port (or change the port in <code>config.php</code>)</li>
<li>Install the necessary software:  <code>apt install redis-server php-redis php-apcu</code></li>
<li>Ensure that the Redis and APCu settings in <code>config.php</code> are according to the documented <a href="https://docs.nextcloud.com/server/29/admin_manual/configuration_server/caching_configuration.html#organizations-with-single-server" rel="nofollow">single-server</a> settings</li></ul></li></ul>

<p>The Memcache settings should look something like the following configuration snippet.  Alternatively, you could enable and use the process socket.</p>

<pre><code class="language-php">
&#39;memcache.local&#39; =&gt; &#39;\OC\Memcache\APCu&#39;,
&#39;memcache.distributed&#39; =&gt; &#39;\OC\Memcache\Redis&#39;,
&#39;memcache.locking&#39; =&gt; &#39;\OC\Memcache\Redis&#39;,
&#39;redis&#39; =&gt; [
     &#39;host&#39; =&gt; &#39;localhost&#39;,
     &#39;port&#39; =&gt; 6379,
],
</code></pre>
]]></content:encoded>
      <guid>https://infosec.press/ktneely/migrating-a-hosted-nextcloud-instance-to-your-home-lab</guid>
      <pubDate>Sun, 24 Nov 2024 00:09:12 +0000</pubDate>
    </item>
    <item>
      <title>Nextcloud administration notes</title>
      <link>https://infosec.press/ktneely/nextcloud-administration-notes</link>
      <description>&lt;![CDATA[&#xA;Nextcloud administration notes&#xA;&#xA;These instructions and administrative notes were written for the pre-built Nextcloud provided by hosting provider Vultr.  As a way to de- #Google my life and take back a bit of #privacy, I have been using a Vultr-hosted instance for a couple years now and it has run quite well.  These notes are really aimed at the small instance for personal use.  Please don’t use my notes if you’re responsible for an enterprise server!&#xA;&#xA;Upgrading Nextcloud&#xA;&#xA;Nextcloud, with all it&#39;s PHP-based functionality, can become temperamental if not upgraded appropriately.  These are my notes to remind me how to now completely break things.  When upgrading, the first pass will usually bring you to the most up-to-date version of Nextcloud in your major release, e.g. an instance running 27.1.4 would be brought up to 27.1.11.   Running the script again would bring the instance to 28.0.x.&#xA;&#xA;To update a Nextcloud server running on the #Vultr service to the latest version, you need to follow the steps below:&#xA;&#xA;Backup your Nextcloud data: Before starting any update process, it&#39;s always a good idea to create a backup of your Nextcloud data. This will ensure that you can restore your data in case of any unexpected issues during the update process.&#xA;&#x9;Shutdown the OS with shutdown -h now&#xA;&#x9;Power down the instance in Vultr&#xA;&#x9;Create a snapshot&#xA;&#x9;Wait&#xA;&#x9;Wait some more - depending on how much data is hosted on the system&#xA;&#x9;Power it back up&#xA;SSH into the Vultr server: To update the Nextcloud server, you need to access the server using SSH. You can use an SSH client such as PuTTY to connect to the Vultr server.&#xA;Switch to the Nextcloud user: Once you are logged in, switch to the Nextcloud user using the following command: sudo su -s /bin/bash www-data.&#xA;Navigate to the Nextcloud directory: Navigate to the Nextcloud directory using the following command: cd /var/www/html  (could be /var/www/nextcloud or other.  Check what&#39;s in use)&#xA;Stop the Nextcloud service: To avoid any conflicts during the update process, stop the Nextcloud service using the following command (as www-data): php occ maintenance:mode --on &#xA;Update the Nextcloud server: To update the Nextcloud server, you need to run the following command(as www-data): php updater/updater.phar. This will start the update process and download the latest version of Nextcloud.&#xA;Update the OS, as needed, with apt upgrade&#xA;Start the Nextcloud service: Once the update is complete and verified, you can start the Nextcloud service using the following command: sudo -u www-data php occ maintenance:mode --off.&#xA;Verify the update: After the update process is complete, you can verify the update by accessing the Nextcloud login page. You should see the latest version of Nextcloud listed on the login page.&#xA;10. Assuming all is running smoothly, the snapshot that was created in step 1 can be safely deleted. Otherwise, they accrue charges on the order of pennies / gigabyte / day.&#xA;&#xA;Some other notes&#xA;Remove files in the trash&#xA;When a user deletes files, it can take a long time from them to actually disappear from the server.&#xA;&#xA;root@cloud:/var/www/html# sudo -u www-data php -f /var/www/html/cron.php&#xA;root@cloud:/var/www/html# sudo -u www-data php occ config:app:delete files\trashbin background\job\expire\trash&#xA;&#xA;Set files to expire&#xA;root@cloud:/var/www/html# sudo -u www-data php occ config:app:set --value=yes iles\trashbin background\job\expire\trash&#xA;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<h1 id="nextcloud-administration-notes">Nextcloud administration notes</h1>

<p>These instructions and administrative notes were written for the pre-built Nextcloud provided by hosting provider <a href="https://vultr.com" rel="nofollow">Vultr</a>.  As a way to de- <a href="/ktneely/tag:Google" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Google</span></a> my life and take back a bit of <a href="/ktneely/tag:privacy" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">privacy</span></a>, I have been using a Vultr-hosted instance for a couple years now and it has run quite well.  These notes are really aimed at the small instance for personal use.  Please don’t use my notes if you’re responsible for an enterprise server!</p>

<h2 id="upgrading-nextcloud">Upgrading Nextcloud</h2>

<p><a href="/ktneely/tag:Nextcloud" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Nextcloud</span></a>, with all it&#39;s PHP-based functionality, can become temperamental if not upgraded appropriately.  These are my notes to remind me how to now completely break things.  When upgrading, the first pass will usually bring you to the most up-to-date version of Nextcloud in your major release, e.g. an instance running <code>27.1.4</code> would be brought up to <code>27.1.11</code>.   Running the script again would bring the instance to <code>28.0.x</code>.</p>

<p>To update a Nextcloud server running on the <a href="/ktneely/tag:Vultr" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Vultr</span></a> service to the latest version, you need to follow the steps below:</p>
<ol><li>Backup your Nextcloud data: Before starting any update process, it&#39;s always a good idea to create a backup of your Nextcloud data. This will ensure that you can restore your data in case of any unexpected issues during the update process.
<ol><li>Shutdown the OS with <code>shutdown -h now</code></li>
<li>Power down the instance in Vultr</li>
<li>Create a snapshot</li>
<li>Wait</li>
<li>Wait some more – depending on how much data is hosted on the system</li>
<li>Power it back up</li></ol></li>
<li>SSH into the Vultr server: To update the Nextcloud server, you need to access the server using SSH. You can use an SSH client such as PuTTY to connect to the Vultr server.</li>
<li>Switch to the Nextcloud user: Once you are logged in, switch to the Nextcloud user using the following command: <code>sudo su -s /bin/bash www-data</code>.</li>
<li>Navigate to the Nextcloud directory: Navigate to the Nextcloud directory using the following command: cd<code>/var/www/html</code>  (could be <code>/var/www/nextcloud</code> or other.  Check what&#39;s in use)</li>
<li>Stop the Nextcloud service: To avoid any conflicts during the update process, stop the Nextcloud service using the following command (as www-data): <code>php occ maintenance:mode --on</code> </li>
<li>Update the Nextcloud server: To update the Nextcloud server, you need to run the following command(as www-data): <code>php updater/updater.phar</code>. This will start the update process and download the latest version of Nextcloud.</li>
<li>Update the OS, as needed, with apt upgrade</li>
<li>Start the Nextcloud service: Once the update is complete and verified, you can start the Nextcloud service using the following command: <code>sudo -u www-data php occ maintenance:mode --off</code>.</li>
<li>Verify the update: After the update process is complete, you can verify the update by accessing the Nextcloud login page. You should see the latest version of Nextcloud listed on the login page.</li>
<li>Assuming all is running smoothly, the snapshot that was created in step 1 can be safely deleted. Otherwise, they accrue charges on the order of pennies / gigabyte / day.</li></ol>

<h2 id="some-other-notes">Some other notes</h2>

<h3 id="remove-files-in-the-trash">Remove files in the trash</h3>

<p>When a user deletes files, it can take a long time from them to actually disappear from the server.</p>

<p>root@cloud:/var/www/html# sudo -u www-data php -f /var/www/html/cron.php
root@cloud:/var/www/html# sudo -u www-data php occ config:app:delete files_trashbin background_job_expire_trash</p>

<h3 id="set-files-to-expire">Set files to expire</h3>

<p>root@cloud:/var/www/html# sudo -u www-data php occ config:app:set —value=yes iles_trashbin background_job_expire_trash</p>
]]></content:encoded>
      <guid>https://infosec.press/ktneely/nextcloud-administration-notes</guid>
      <pubDate>Wed, 20 Nov 2024 23:03:27 +0000</pubDate>
    </item>
    <item>
      <title>Using an eGPU to provide critical processing for AI research (and games) - Part 1: Research and Planning</title>
      <link>https://infosec.press/ktneely/using-an-egpu-to-provide-critical-processing-for-ai-research-and-games-part</link>
      <description>&lt;![CDATA[This is a log of experiences and experimentation in moving from more traditional home computing –ATX cases, components, water cooling, and continual upgrades– to something a bit more modular in terms or GPU computing power.  This guide probably isn’t for most people.  It’s a collection of notes I took during the process, strung together in case they might help someone also looking to pack multiple power-use-cases into as small a format as possible.&#xA;&#xA;  [Note:] A later evolution should involve a similar down-sizing of a home storage appliance.&#xA;&#xA;Objectives&#xA;An external GPU requires more setup, and -let’s face it- fiddling than getting a gaming laptop or a full PC case that can handle multi-PCIe slot GPUs.  So why do it?  A couple objectives had been bouncing around in my head that led me to this:&#xA;I need a system that can run compute-intensive and GPU-intensive tasks for long periods of time, e.g. machine learning, and training large language models&#xA;I need a light laptop for travel (i.e. I don’t want to carry around a 5+lb./2.5 kilo gaming laptop)&#xA;I want to be able to play recent games, but don’t need to be on the cutting edge of gaming&#xA;I want to reduce the overall space footprint for my computing devices.&#xA;&#xA;In summary, I want my systems to be able to handle the more intensive tasks I plan to throw at them: Windows laptop for gaming and also travel, the stay–at-home system can perform long-running tasks such as AI model training, password cracking, and daily cron jobs.&#xA;&#xA;Things I don’t care about:&#xA;being able to play games while traveling&#xA;document data diverging due to on multiple systems:  I use a personal #NextCloud instance to keep my documents in sync.  &#xA;&#xA;Current State&#xA;I have a number of personal computing devices in my home lab for testing things and running different tasks, but they’re all aging a bit, so it is time to upgrade:&#xA;my Razer Blade 13 laptop is from 2016&#xA;my main tower/gaming PC is from 2015 with an Nvidia GTX 1060 &#xA;an i5 NUC from 2020  (unused)&#xA;an i3 NUC from 2013  (unused)&#xA;A 6TB NAS with 4 aging 2TB drives from 2014&#xA;Raspberry Pis and some other non-relevant computing devices&#xA;&#xA;Configurations&#xA;With the objectives in mind, and realizing that my workload system would almost certainly run Linux, the two configurations for experimentation were:&#xA;Intel NUC with an eGPU&#xA;Lightweight laptopi (e.g. Dell XPS 13) with an eGPU &#xA;&#xA;  [Note:] The computing systems must support at least Thunderbolt3, though version 4 would be best for future-proofing.&#xA;&#xA;Shows an Nvidia GTX 1060 in a Razer Core X Chroma eGPU enclosure&#xA;Image: Original GTX 1060 GPU slotted in the Razer Core X Chroma enclosure&#xA;&#xA;Background Research&#xA;Before starting on this endeavor, I did a lot of research to see how likely I’d be able to succeed.  The two best sources I found was the eGPU.io site with many reviews and descriptions of how well specific configurations worked (or didn’t).  They also have nice “best laptop for eGPU” and Best eGPU Enclosures matrices.&#xA;&#xA;Nvidia drivers and Ubuntu&#xA;Installing Nvidia drivers under #Ubuntu is pretty straightforward these days, with a one-click install option built-in to the operating system itself.  The user can choose between versions, and my research showed that most applications required either version 525 or 530.  I installed 530.&#xA;&#xA;Nvidia and Ubuntu reference links&#xA;  Nvidia drivers on ubuntu (for gaming)&#xA;  how to install drivers on Ubuntu 20.04&#xA;  Install NVIDIA Driver &amp; Switch Between Intel and NVIDIA in Ubuntu 22.04&#xA;  Nvidia driver download page&#xA;&#xA;eGPU information&#xA;The best two sources I found for information on configuring and using eGPUs were:&#xA;r/eGPU on reddit&#xA;&#x9;their “so you’re thinking about an eGPU” guide&#xA;egpu.io  &#xA;&#xA;Proof-of-concept&#xA;Having read a fair amount about the flakiness of certain #eGPU setups, I approached this project with a bit of caution.  My older tower had a respectable, if aging, GTX 1060 6GB in it.  Since I already had a recent Core i5 Intel NUC running Ubuntu and some test machine learning applications, so all I needed to fully test this was the enclosure.  Researching the various enclosure options, I chose this one because:&#xA;  the Razer Core X series appears to have some of the best out-of-the-box compatibility&#xA;  I’ve been impressed with my aging Razer laptop, so I know they build quality components&#xA;  The Chroma version has what is basically an USB hub in the back with 4 USB 3.x ports and an ethernet jack added to the plain Core X version&#xA;My thinking was that this system could not only provide GPU, but also act as an easy dock-hub for my primary computers.  This didn’t work out quite as I planned (more in the next post).&#xA;&#xA;The included thunderbolt cable is connected from the NUC to the eGPU.  Theoretically, the standard peripherals (keyboard, mouse, etc.) should be connected to the eGPU hub and everything will “just work”.  However, in my testing, things worked best with the peripheral hub I use plugged into the NUC and only the #Thunderbolt cable plugged into the enclosure.   In the spirit of IT troubleshooters everywhere: start by making the least amount of change and iterate from there.&#xA;&#xA;Intel NUC on top of Razer Core X Chroma eGPU&#xA;Image:  Just the enclosure with a NUC on top.&#xA;&#xA;Experience&#xA;The NUC was on Ubuntu 20.04.  The drivers installed just fine, but the system just wouldn’t see the GPU.  Doing some research, it looked like people were having better results with more recent versions of Ubuntu, so I did a quick sudo apt dist-upgrade and upgraded the system to 22.XX.  The GPU worked!   However, the advice I’d been given was to upgrade to 23.04, so I did that and still the system worked fine.&#xA;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>This is a log of experiences and experimentation in moving from more traditional home computing –ATX cases, components, water cooling, and continual upgrades– to something a bit more modular in terms or GPU computing power.  This guide probably isn’t for most people.  It’s a collection of notes I took during the process, strung together in case they might help someone also looking to pack multiple power-use-cases into as small a format as possible.</p>

<blockquote><p>[<strong>Note:</strong>] A later evolution should involve a similar down-sizing of a home storage appliance.</p></blockquote>

<h2 id="objectives">Objectives</h2>

<p>An external GPU requires more setup, and -let’s face it- <em>fiddling</em> than getting a gaming laptop or a full PC case that can handle multi-PCIe slot GPUs.  So why do it?  A couple objectives had been bouncing around in my head that led me to this:
– I need a system that can run compute-intensive <em>and</em> GPU-intensive tasks for long periods of time, e.g. machine learning, and training large language models
– I need a light laptop for travel (i.e. I don’t want to carry around a 5+lb./2.5 kilo gaming laptop)
– I want to be able to play recent games, but don’t need to be on the cutting edge of gaming
– I want to reduce the overall space footprint for my computing devices.</p>

<p>In summary, I want my systems to be able to handle the more intensive tasks I plan to throw at them: Windows laptop for gaming and also travel, the stay–at-home system can perform long-running tasks such as AI model training, password cracking, and daily cron jobs.</p>

<p><strong>Things I don’t care about:</strong>
– being able to play games while traveling
– document data diverging due to on multiple systems:  I use a personal <a href="/ktneely/tag:NextCloud" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">NextCloud</span></a> instance to keep my documents in sync.</p>

<h3 id="current-state">Current State</h3>

<p>I have a number of personal computing devices in my home lab for testing things and running different tasks, but they’re all aging a bit, so it is time to upgrade:
– my Razer Blade 13 laptop is from 2016
– my main tower/gaming PC is from 2015 with an Nvidia GTX 1060
– an i5 NUC from 2020  (unused)
– an i3 NUC from 2013  (unused)
– A 6TB NAS with 4 aging 2TB drives from 2014
– Raspberry Pis and some other non-relevant computing devices</p>

<h3 id="configurations">Configurations</h3>

<p>With the objectives in mind, and realizing that my workload system would almost certainly run Linux, the two configurations for experimentation were:
– <a href="https://www.reddit.com/r/eGPU/comments/a6tyfy/intel_nuc_with_an_egpu/" rel="nofollow">Intel NUC with an eGPU</a>
– Lightweight laptopi (e.g. Dell XPS 13) with an eGPU</p>

<blockquote><p>[<strong>Note:</strong>] The computing systems <em>must</em> support at least Thunderbolt3, though version 4 would be best for future-proofing.</p></blockquote>

<p><img src="https://pixel.infosec.exchange/storage/m/_v2/540237025755407403/186f813ba-297a89/5EqG0fKlWVSH/4CzZc3AX6skl0d0u3s9YMSegqhxOe2BUPRlKq8BN.jpg" alt="Shows an Nvidia GTX 1060 in a Razer Core X Chroma eGPU enclosure">
<strong>Image:</strong> <em>Original GTX 1060 GPU slotted in the Razer Core X Chroma enclosure</em></p>

<h2 id="background-research">Background Research</h2>

<p>Before starting on this endeavor, I did a lot of research to see how likely I’d be able to succeed.  The two best sources I found was the eGPU.io site with many reviews and descriptions of how well specific configurations worked (or didn’t).  They also have nice “best laptop for eGPU” and <a href="https://egpu.io/best-egpu-buyers-guide/" rel="nofollow">Best eGPU Enclosures</a> matrices.</p>

<h3 id="nvidia-drivers-and-ubuntu">Nvidia drivers and Ubuntu</h3>

<p>Installing Nvidia drivers under <a href="/ktneely/tag:Ubuntu" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Ubuntu</span></a> is pretty straightforward these days, with a one-click install option built-in to the operating system itself.  The user can choose between versions, and my research showed that most applications required either version 525 or 530.  I installed 530.</p>

<h4 id="nvidia-and-ubuntu-reference-links">Nvidia and Ubuntu reference links</h4>
<ul><li><a href="https://www.makeuseof.com/install-nvidia-drivers-ubuntu/" rel="nofollow">Nvidia drivers on ubuntu (for gaming)</a></li>
<li>how to <a href="https://phoenixnap.com/kb/install-nvidia-drivers-ubuntu" rel="nofollow">install drivers on Ubuntu 20.04</a></li>
<li><a href="https://ubuntuhandbook.org/index.php/2021/06/install-nvidia-driver-switch-between-intel-nvidia-ubuntu/" rel="nofollow">Install NVIDIA Driver &amp; Switch Between Intel and NVIDIA in Ubuntu 22.04</a></li>
<li><a href="https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#pre-installation-actions" rel="nofollow">Nvidia driver download page</a></li></ul>

<h3 id="egpu-information">eGPU information</h3>

<p>The best two sources I found for information on configuring and using eGPUs were:
– <a href="https://www.reddit.com/r/eGPU" rel="nofollow">r/eGPU</a> on reddit
    – their “so you’re thinking about an eGPU” <a href="https://www.reddit.com/r/eGPU/comments/5jpf2x/diy_egpu_101_introduction_to_egpu/" rel="nofollow">guide</a>
– <a href="https://egpu.io/" rel="nofollow">egpu.io</a></p>

<h2 id="proof-of-concept">Proof-of-concept</h2>

<p>Having read a fair amount about the flakiness of certain <a href="/ktneely/tag:eGPU" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">eGPU</span></a> setups, I approached this project with a bit of caution.  My older tower had a respectable, if aging, GTX 1060 6GB in it.  Since I already had a recent Core i5 Intel NUC running Ubuntu and some test machine learning applications, so all I needed to fully test this was the enclosure.  Researching the various enclosure options, I chose this one because:
  – the Razer Core X series appears to have some of the best out-of-the-box compatibility
  – I’ve been impressed with my aging Razer laptop, so I know they build quality components
  – The <em>Chroma</em> version has what is basically an USB hub in the back with 4 USB 3.x ports and an ethernet jack added to the plain Core X version
My thinking was that this system could not only provide GPU, but also act as an easy dock-hub for my primary computers.  This didn’t work out quite as I planned (more in the next post).</p>

<p>The included thunderbolt cable is connected from the NUC to the eGPU.  Theoretically, the standard peripherals (keyboard, mouse, etc.) should be connected to the eGPU hub and everything will “just work”.  However, in my testing, things worked best with the peripheral hub I use plugged into the NUC and only the <a href="/ktneely/tag:Thunderbolt" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Thunderbolt</span></a> cable plugged into the enclosure.   In the spirit of IT troubleshooters everywhere: start by making the least amount of change and iterate from there.</p>

<p><img src="https://pixel.infosec.exchange/storage/m/_v2/540237025755407403/186f813ba-297a89/PoCLulKAvqgL/Xw6gTQSWCzoRWoF02V4ZRMS57bDZqqShFMHqDo05.jpg" alt="Intel NUC on top of Razer Core X Chroma eGPU">
<strong>Image:</strong>  <em>Just the enclosure with a NUC on top.</em></p>

<h3 id="experience">Experience</h3>

<p>The NUC was on Ubuntu 20.04.  The drivers installed just fine, but the system just wouldn’t see the GPU.  Doing some research, it looked like people were having better results with more recent versions of Ubuntu, so I did a quick <code>sudo apt dist-upgrade</code> and upgraded the system to 22.XX.  The GPU worked!   However, the advice I’d been given was to upgrade to 23.04, so I did that and still the system worked fine.</p>
]]></content:encoded>
      <guid>https://infosec.press/ktneely/using-an-egpu-to-provide-critical-processing-for-ai-research-and-games-part</guid>
      <pubDate>Tue, 04 Jul 2023 03:35:34 +0000</pubDate>
    </item>
    <item>
      <title>Migrating PasswordSafe to KeepassXC</title>
      <link>https://infosec.press/ktneely/migrating-passwordsafe-to-keepassxc</link>
      <description>&lt;![CDATA[Migrating PasswordSafe to KeepassXC&#xA;&#xA;I’ve been a longtime user of #PasswordSafe (or, “PWsafe”), back since Bruce Schneier was managing authorship and maintenance.  With all the issues experienced by online providers like LastPass and 1Password (but especially LastPass, by miles), I think the usage of a local password database with sync to a personal #NextCloud instance is the way to go.  I’m happy with PWsafe; it’s worked well over the years, but I need to share a few passwords and would like some expanded functionality such as managing SSH keys, so I looked to #KeePassXC, which appears to be the most up-to-date and maintained branch of the KeePass and KeePassX family.  KeePassXC is desirable because it is natively multi-platform, whereas the original KeePass is written for Windows, and emulators are required to use it on operating systems like Linux.&#xA;&#xA;Importing passwords&#xA;There is no direct import from a PasswordSafe format to KeePass database format using KeePassXC like there is from LastPass to KeePass.  A tab-delimited file can be exported from PWsafe, and KeePassXC can import a comma-delimited (“CSV”) file, however, I make heavy use of nested groups, and the work to prepare the CSV file looked like a major pain.   Luckily, the original version of KeePass supports direct import from PWsafe.&#xA;&#xA;Armed with that knowledge, this was my path to import my passwords&#xA;Open PasswordSafe and export the database in the XML format (be careful with this file and delete when done!)&#xA;Download latest KeePass 2.x from https://keepass.info/&#xA;Open KeePass, create a new KeePass version 2database, and import the XML file&#xA;Export the file as KeePass version 1.x database format&#xA;Close KeePass 2.x&#xA;Open KeePassXC and create a new database in a temporary location (doesn’t matter, we wont’ use it)&#xA;Import the KeePass 1.x database with the passwords &#xA;When prompted, choose the location and name where you want the database&#xA;Done!&#xA;&#xA;KeePass import dialogue box&#xA;&#xA;Finishing Up&#xA;Make sure to explore the settings, such as adding a Yubikey and/or keyfile.   When everyhing is as you want it and working, delete the interim files (XML, KP 1.x and 2.x databases), and make a plan to retire the old PasswordSafe data.&#xA;&#xA;References&#xA;KeePassXC&#xA;&#x9;KeePassXC user guide&#xA;KeePass - original&#xA;Yubikey and KeePass&#xA;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<h2 id="migrating-passwordsafe-to-keepassxc">Migrating PasswordSafe to KeepassXC</h2>

<p>I’ve been a longtime user of <a href="/ktneely/tag:PasswordSafe" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">PasswordSafe</span></a> (or, “PWsafe”), back since Bruce Schneier was managing authorship and maintenance.  With all the issues experienced by online providers like LastPass and 1Password (but especially LastPass, by miles), I think the usage of a local password database with sync to a personal <a href="/ktneely/tag:NextCloud" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">NextCloud</span></a> instance is the way to go.  I’m happy with PWsafe; it’s worked well over the years, but I need to share a few passwords and would like some expanded functionality such as managing SSH keys, so I looked to <a href="/ktneely/tag:KeePassXC" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">KeePassXC</span></a>, which appears to be the most up-to-date and maintained branch of the KeePass and KeePassX family.  KeePassXC is desirable because it is natively multi-platform, whereas the original KeePass is written for Windows, and emulators are required to use it on operating systems like Linux.</p>

<h3 id="importing-passwords">Importing passwords</h3>

<p>There is no direct import from a PasswordSafe format to KeePass database format using KeePassXC like there is from <a href="https://www.makeuseof.com/how-to-switch-passwords-lastpass-keepass/" rel="nofollow">LastPass to KeePass</a>.  A tab-delimited file can be exported from PWsafe, and KeePassXC can import a comma-delimited (“CSV”) file, however, I make heavy use of nested groups, and the work to prepare the CSV file looked like a major pain.   Luckily, the original version of KeePass supports direct import from PWsafe.</p>

<p>Armed with that knowledge, this was my path to import my passwords
1. Open PasswordSafe and export the database in the XML format (be careful with this file and delete when done!)
2. Download latest KeePass 2.x from <a href="https://keepass.info/" rel="nofollow">https://keepass.info/</a>
3. Open KeePass, create a new KeePass version 2database, and import the XML file
4. Export the file as KeePass version 1.x database format
5. Close KeePass 2.x
6. Open KeePassXC and create a new database in a temporary location (doesn’t matter, we wont’ use it)
7. Import the KeePass 1.x database with the passwords
8. When prompted, choose the location and name where you want the database
9. Done!</p>

<p><img src="https://pixel.infosec.exchange/storage/m/_v2/540237025755407403/42a8ecf32-5a8865/IRAeksFz0ugq/Wj6topCxB21yyO1lROyIbeXSfkFhdx7Lysa9kGSK.png" alt="KeePass import dialogue box"></p>

<h2 id="finishing-up">Finishing Up</h2>

<p>Make sure to explore the settings, such as adding a Yubikey and/or keyfile.   When everyhing is as you want it and working, delete the interim files (XML, KP 1.x and 2.x databases), and make a plan to retire the old PasswordSafe data.</p>

<h3 id="references">References</h3>
<ul><li><a href="https://keepassxc.org/" rel="nofollow">KeePassXC</a>
<ul><li><a href="https://keepassxc.org/docs/KeePassXC_UserGuide.html" rel="nofollow">KeePassXC user guide</a></li></ul></li>
<li><a href="https://keepass.info/" rel="nofollow">KeePass</a> – original</li>
<li><a href="https://support.yubico.com/hc/en-us/articles/360013779759-Using-Your-YubiKey-with-KeePass" rel="nofollow">Yubikey and KeePass</a></li></ul>
]]></content:encoded>
      <guid>https://infosec.press/ktneely/migrating-passwordsafe-to-keepassxc</guid>
      <pubDate>Sun, 12 Mar 2023 22:42:53 +0000</pubDate>
    </item>
  </channel>
</rss>