compiling-nextcloud-for-linux

Hey there, Internet peeps! Steph and I have been discussing cloud storage. Last week we introduced a shared solution that we love here at The Nerd Garden. NextCloud. We even showed you how to setup your NextCloud server.

This week, we’re going to help you put all that cloud awesomeness to use. Sure, you can use the web browser to get to your files, but one of the main features we both use is the NextCloud desktop client.
Once you install it, the client creates a local folder on your PC or Mac. Then it syncs to the server whenever you reconnect to the Internet.

Steph discovered that NextCloud finally released a desktop client for Mac. It was previously delayed due to licensing issues and had just become available. She was super-excited. Yippy-skippy for her.

I, on the other hand, was not so enthusiastic. That is until I checked the NextCloud Downloads page and found a NextCloud client for Linux. YES! I WANT THAT!

But wait… Only the source code for the NextCloud Linux client was available. There was no installation file. What the heck? This seriously bummed me out. But then I thought, “Hey I’m a geek who loves code. I can do this.”

So I used the source and compiled my very own copy of the NextCloud desktop client for Linux. Now I’m fairly familiar with compile tools and libraries and all that sort of stuff, but I did run into a few obstacles. Since I’m kind of a nice guy, I’d like to share my process with you. The following is my step-by-step guide for compiling the NextCloud desktop client for Linux.

Installing Dependencies

I’m using LinxMint 18, but the procedure is identical with Ubuntu 16.04.

  1. We will need git to sync the source code and cmake to set up the build environment.
  2. Open a terminal window and use the code below to install those using these commands.
    sudo apt-get install git cmake

Update the qtkeychain Libraries

  1. The qtkeychain-dev and qt5keychain-dev libraries need to be at least version 0.7.0.
  2. On Ubuntu these librarys will need updated.
  3. We’ll use a PPA with the updated libraries. Thanks Filip Dorosz for making these libraries available!
  4. In your terminal window, we will install the PPA using the code below:
    sudo add-apt-repository ppa:fihufil/test-02
    sudo apt-get update
  5. Install the updated libraries
    sudo apt-get install qtkeychain-dev qt5keychain-dev

Install NextCloud Client Dependencies

NextCloud is a fork of OwnCloud and the Desktop client we are compiling actually pulls in source code from OwnCloud.

  1. We will need to add the OwnCloud code repository using these commands:
    sudo sh -c "echo 'deb-src http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Ubuntu_16.04/ /' >> /etc/apt/sources.list.d/owncloud-client.list"
    sudo apt-get update
    sudo apt-get build-dep owncloud-client

Download the NextCloud Source Code From Github

  1. The code is located at: https://github.com/nextcloud/client_theming
    git clone https://github.com/nextcloud/client_theming.git
    cd client_theming
    git submodule update --init --recursive

Compile and Install

  1. In a terminal window, enter the following code:
 mkdir build-linux
 cd build-linux
 cmake -D OEM_THEME_DIR=`pwd`/../nextcloudtheme ../client
 make
 sudo make install
  1. Update the system PATH to include our newly compiled libraries. The NextCloud client will be installed to /usr/local/bin/ which is all well and good, but the libraries are actually installed to /usr/local/lib/x86_64-linux-gnu
    On ubuntu this location is not in the path by default. We need to add it.

    sudo nano /etc/ld.so.conf.d/x86_64-linux-gnu.conf
  2. Add this line at the end:
    /usr/local/lib/x86_64-linux-gnu
  3. Apply that change by running:
    sudo ldconfig
  4. Run the client
 alt + f2
 nextcloud

nextcloud_linux_client

4 thoughts on “How To Compile The NextCloud Client For Linux

  • Nebucatnetzer

    Hello Aaron,

    I’ve added your guide to this repository which some slight changes hopefully this is okay with you.
    https://github.com/compiling-nextcloud/compiling-nextcloud/blob/master/Linux/Ubuntu/Ubuntu_16.04.md

    Regards

    Nebucatnetzer

    • Aaron

      So glad you found this guide useful. I see you’ve credited TheNerdGarden on github so adding it there is totally OK with me. I use github all the time. I don’t know why I didn’t think of that. Perhaps I’ll add future guides, scripts, programs, etc. there for TheNerdGarden as I post about them.

      Aaron

  • Dave

    Thanks for this guide.

    • Steph

      Sure! Do stop back in again, Dave. 🙂

Comments are closed.