<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>nextcloud &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/nextcloud/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Tue, 11 Apr 2023 15:59:41 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>nextcloud &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[NextCloud Client Command Line]]></title>
		<link>https://shkspr.mobi/blog/2023/04/nextcloud-client-command-line/</link>
					<comments>https://shkspr.mobi/blog/2023/04/nextcloud-client-command-line/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Thu, 13 Apr 2023 11:34:11 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nextcloud]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=45487</guid>

					<description><![CDATA[I have a headless server - one without a GUI - which I use as a NextCloud client. My laptop, phone, tablet, and server all sync with a cloud-based NextCloud instance.  But, sadly, NextCloud don&#039;t offer a way for servers to speak to servers. If you try to run apt install nextcloud it will try to install 300MB of GUI dependencies which you just can&#039;t use.  Luckily, there&#039;s a way around all that!…]]></description>
										<content:encoded><![CDATA[<p>I have a headless server - one without a GUI - which I use as a NextCloud client. My laptop, phone, tablet, <em>and</em> server all sync with a cloud-based NextCloud instance.</p>

<p>But, sadly, <a href="https://github.com/nextcloud/desktop/issues/1203">NextCloud don't offer a way for servers to speak to servers</a>. If you try to run <code>apt install nextcloud</code> it will try to install 300MB of GUI dependencies which you just can't use.</p>

<p>Luckily, there's a way around all that! It's a bit convoluted, so here's a guide.</p>

<h2 id="download-the-latest-appimage"><a href="https://shkspr.mobi/blog/2023/04/nextcloud-client-command-line/#download-the-latest-appimage">Download the latest AppImage</a></h2>

<p>Grab the link for <a href="https://github.com/nextcloud/desktop/releases/latest/">the most recent AppImage</a></p>

<p>On your server:</p>

<pre><code class="language-_">mkdir nextcloudapp
cd nextcloudapp
wget https://github.com/nextcloud/desktop/releases/download/????.AppImage -O Nextcloud.AppImage
</code></pre>

<p>Make it executable:</p>

<pre><code class="language-_">chmod +x Nextcloud.AppImage
</code></pre>

<p>Next, extract it:</p>

<pre><code class="language-_">./Nextcloud.AppImage --appimage-extract
</code></pre>

<p>That will place all the files in <code>squashfs-root/</code></p>

<p>I moved all the files and folders out of there to a more convenient location.</p>

<p>You may need to install some dependencies:</p>

<pre><code class="language-_">sudo apt install libgl1 libharfbuzz0b
</code></pre>

<p>Finally, you need to export the libraries which were in the app image:</p>

<pre><code class="language-_">export LD_LIBRARY_PATH=~/nextcloudapp/usr/lib
</code></pre>

<h2 id="running-it"><a href="https://shkspr.mobi/blog/2023/04/nextcloud-client-command-line/#running-it">Running it</a></h2>

<p>I recommend creating an app specific password on your NextCloud admin interface.</p>

<p>You can run NextCloud as a one-off job using:</p>

<pre><code class="language-_">./nextcloudcmd -u "MyUserName" -p "P4ssw0rd" /path/to/NextCloud/ https://your_online.nextcloud.example/
</code></pre>

<p>That will spit out a <em>lot</em> of log files. You can make it run silently with the <code>-s</code> option. Probably best to run it in a <code>tmux</code>.</p>

<h2 id="make-it-persistent"><a href="https://shkspr.mobi/blog/2023/04/nextcloud-client-command-line/#make-it-persistent">Make it persistent</a></h2>

<p>Sadly, there's no way to <a href="https://help.ubuntu.com/community/EnvironmentVariables#File-location_related_variables">permanently set the LD_LIBRARY_PATH</a>. So you'll need to export the library each time you want to sync.</p>

<p>If only NextCloud offered a headless daemon. Ah well!</p>

<h2 id="bugs"><a href="https://shkspr.mobi/blog/2023/04/nextcloud-client-command-line/#bugs">Bugs</a></h2>

<p>There is a bug with the CLI version where it <a href="https://github.com/nextcloud/desktop/issues/5591">won't download files with a colon in the filename</a>.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=45487&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2023/04/nextcloud-client-command-line/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
