Nextcloud HEIC support

Posted January 10, 2022 156 views
ApachePHPServer OptimizationInitial Server SetupUbuntu 18.04DigitalOcean Droplets

HEIC support will not work on Nextcloud. I followed the tutorial for deploying a nextcloud server on an Ubuntu 18.04 droplet. Everything works well; I can access it through the web and the app. The functonality is there, aside from one issue. I cannot get the HEIC support to work. I keep getting the error “the library imagick is not available”. I found a few other tutorials and tried to install, reinstall and update imagick. I thought it went fine. When I do the GREP command it shows it there. The last step appears to be my issue. I cannot restart apache2. It says there is no service available. Any help is greatly appreciated.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hello, @adamSnorkler

Have you completed the initial server configuration by following this tutorial?

You can also check on the status of the apache2 service using systemctl:

  • sudo systemctl status apache2

The same article covers the PHP installation, but you can also check articles like:

Have you installed Imagick as PHP extension during the PHP installation? What happens when you execute the following commands on the server?

  • php -i | grep -i imagick
  • php -m | grep imagick

Can you share the output? Also what you can do is to create an info.php file. You can create a file named info.php (the name doesn’t really matter) and put the following content in the file:

  • <?php
  • phpinfo();

You can then check which is the configuration file - php.ini that is currently used and so we can edit it. You can also check this with the PHP -i command again:

  • php -i | grep -i php.ini

Then you can edit the listed php.ini and add the following line:


Note that this line can already exist there but might be commented out, e.g listed like this:

If that is the case just remove the ; and save the php.ini file.

Once this is done you can restart the Apache server and check again.

  • sudo service apache2 restart

Hope that this helps!

by Mark Drake
by Erika Heidi
A "LAMP" stack is a group of open source software that is typically installed together to enable a server to host dynamic websites and web apps. This stack typically consists of the Linux operating system, the Apache web server, a MySQL database, and PHP, a dynamic content processor. This tutorial serves as a guide for installing these components on an Ubuntu 18.04 server.
  • Alex,

    I appreciate the response but have lost access to the server via the web. When I initially installed nextcloud, I did so on a basic Ubuntu server without the LAMP stack installed. Nextcloud ran without it. I even added external storage and setup users; HTTPS worked, the app worked and I could access it through the sudomain I setup (I use godaddy and changed the A record there). It worked as I hoped, aside from the imagick issue that brought me here.

    After seeing your post and looking at other tutorials, I installed the LAMP stack as directed then rebooted the server. This created a new problem. When I enter the url, it will not connect. It says: “[] refused to connect”. I disabled UFW and tried it again. Still nothing.

    I can go to the bare IP address, but I see the “apache2 Ubuntu default page”, not the nextcloud login/homescreen. I cannot access HTTPS at all. Seems to me the LAMP stack is causing me a headache and I am frustrated.

    I did do some troubleshooting on the other issue while I tried to fix the connection issue. When I checked the status of apache2, it tells me it is “Active: active (running)”.

    The two grep commands resuled in nothing. There was no output when I entered either of them. I did not see “;extension=imagick” in the .ini file. In fact, I did not see the work “imagick” in there at all. Should I just add it, sans the “;” up where I saw a list of extensions?

    It is also worth noting that I tried starting from scratch. I created the droplet server, installed the LAMP stack and installed nextcloud. I could not get passed the letsencrypt step. I could never get to the nextcloud start page in the browser, even before that step.

    I tried various scenarios, and kept getting the same basic error when trying to get the certificate: my server was not responding or refused connection. Something to that effect. I cannot help but think it is all related.

    Again, I appreciate your help and your patience.

    Take care,


  • @alexdo As a follow up, when I go to [], as with the bare IP address, I see the Apache2 Ubuntu landing page. I am unable to access via HTTPS. I get the “refused to connect” message when I try. How do I fix this? I have tried to find a solution albeit unsuccessfully. I cannot get back to the nextcloud landing page.

    Is there a better way to install Nextcloud on a server with LAMP installed? It appears all my problems arise when I try to install nextcloud on a server with apache and php. That seems odd since I apparently need them for imagemagick to work.