How to add a social component to your Nextcloud instance

If Nextcloud has become your on-premise cloud solution, you might be interested to know there's a social component you can add. Jack Wallen shows you how.

nextcloudhero.jpg

Image: Jack Wallen

If you've watched The Social Dilemma, you've probably become quite hesitant to be a part of social networking. At the same time, you don't want to miss out on communicating with those in your various circles.

I, for one, have pulled back drastically on my usage of Facebook and might well end that relationship soon. Because of that, I've been thinking of ways to supplement my social interaction. To that end, I reached out to my primary connection with Nextcloud to offer up an idea. Said idea was that the developers should add a social component to the platform. The response didn't surprise me--Nextcloud always seems to be one step ahead. My contact informed me they already have such an app, called Social, but they "had plans."

I like it when great developers, working on a great platform, have "plans." I hope said plans include expanding the social component of Nextcloud to give it a wider berth of features than what their current offering has, which is pretty limited.

Until then, I wanted to walk you through the process of adding their Social app, which offers a functionality similar to Twitter. In effect, you could add a Twitter-like option for your on-premise cloud solution. This app allows you to post to all of your followings within your Nextcloud instance, post to public timelines, post privately, and send direct messages. 

Note: The Social app is still in alpha, so your mileage may vary on how well it performs. I've had success getting the app installed and working, and I can post to the local timeline. However, I've found issues following other users, which means you cannot currently post to users' timelines. 

Even with that issue (remember, this is alpha software), Social is a worthwhile component to get installed on your Nextcloud cloud instance. As the app evolves, issues will be fixed and new features added. 

SEE: Top cloud providers in 2020: AWS, Microsoft Azure, and Google Cloud, hybrid, SaaS players (TechRepublic)

How to install Social on Nextcloud

The Social app is installed on Nextcloud in the same way you'd install any other app. There is, however, one extra step you must take. 

To install Social, log in to your Nextcloud instance as an admin user. Click on your user profile and then click Apps. From the resulting window, type social in the search field and, when the Social entry appears, click the associated Download And Enable button. 

Once the Social app is installed, you'll find a new icon on your Nextcloud toolbar (Figure A).

Figure A

sociala.jpg

The Social app is represented in the toolbar by a heart icon.


Click on the heart icon to start using Social.

How to fix the service discovery error

If you've installed Nextcloud within a subfolder of your web server's document root, you'll receive a service discovery error when you attempt to use Social. Why? Because Social expects Nextcloud to be installed in the document root of the server. In some instances, this is simply not possible--such as when you have multiple sites housed within the document root. When that's the case, you might have installed Nextcloud within /var/www/html/nextcloud. This will cause the service discovery error.

If you find that to be the case, the solution is actually quite simple. This first solution applies to the Apache web server.

Log in to the server hosting Nextcloud, via SSH. Create a new .htaccess file within /var/www/html with the command:

sudo nano /var/www/html/.htaccess

In that file, paste the following:

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule ^\.well-known/host-meta /nextcloud/public.php?service=host-meta [QSA,L]
  RewriteRule ^\.well-known/host-meta\.json /nextcloud/public.php?service=host-meta-json [QSA,L]
  RewriteRule ^\.well-known/webfinger /nextcloud/public.php?service=webfinger [QSA,L]
  RewriteRule ^\.well-known/carddav /nextcloud/remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /nextcloud/remote.php/dav/ [R=301,L]
</IfModule>

Save and close the file.

Restart Apache with the command:

sudo systemctl restart apache2

If you use NGINX as your web server, you need to make sure to either uncomment or add the following lines in your NGINX Nextcloud configuration file:

location ^~ /.well-known {
        # The following 6 rules are borrowed from `.htaccess`
        rewrite ^/\.well-known/host-meta\.json  /public.php?service=host-meta-json  last;
        rewrite ^/\.well-known/host-meta        /public.php?service=host-meta       last;
        rewrite ^/\.well-known/webfinger        /public.php?service=webfinger       last;
        rewrite ^/\.well-known/nodeinfo         /public.php?service=nodeinfo        last;
        location = /.well-known/carddav     { return 301 /remote.php/dav/; }
        location = /.well-known/caldav      { return 301 /remote.php/dav/; }
        try_files $uri $uri/ =404;
}

Save and close the file. Restart NGINX with the command:

sudo systemctl restart nginx

How to access Nextcloud with the change in place

Once you've made the above changes, you will now access Nextcloud from the document root. So instead of http://SERVER/nextcloud (where SERVER is either the IP address or domain of the Nextcloud server), the address would simply be http://SERVER (where SERVER is either the IP address or domain of the Nextcloud server).

At this point, the Social app will work. You can start posting, replying, and viewing your local timeline (Figure B).

Figure B

socialb.jpg

A few posts on the local timeline to demonstrate how Nextcloud Social looks.

A ways to go

As I already stated, Social is still in the alpha stages, so it's not really ready for prime time. Even so, it shows a lot of promise, and if the developers continue working on this, it could become a very important component for the Nextcloud on-premise cloud solution. 

Install this Social app and start kicking the tires. Make sure to regularly check for updates, so the app receives the necessary bug fixes and new features. 

Also see