Custom favicons in theme


How can I use custom favicons in my custom theme in Nextcloud 10.0.2 ?


1 Like

I had the same Question before and find the answer myself. put the favicons for the Apps in /themes//apps//img/favicon.ico. Now you should refresh all your Caches, including the Server Caches.

Thanks to both of you for your input, it works nicely.

Unfortunately this does not work anymore with Nextcloud 11. Where do you need to put my favicon.ico file in order to work? I am using my own theme.

Hi Nextcloud support.

Please help, I used to have a custom theme too, until I updated to NC11.

I am not sure but I don’t think my favicon is being updated… please…


nevemind, it doesn’t pick it up from themes folder, had to drop it to core folder

Nextcloud: Why do we need to copy the favicon in the core folder? that goes against the whole theming principle. Isn’t it possible to store the favicons in the theme folder? if yes, where???

Mine is stored in:

nextcloud/themes/<theme name>/core/img/favicon.ico

When checking the webpage details it shows clearly it is getting it from the correct location:

<link rel="icon" href="/themes/wijman/core/img/favicon.ico">

Make sure the permissions are set correctly. Mine are set to:

-rw-r--r-- 1 www-data www-data 4286 Mar 9 13:25 favicon.ico

Thanks for the tip, I checked the permissions of my favicon.ico file in my theme and these are fine. When I do a view source of the login page of Nextcloud I see the following link tag for the favicon:

<link rel="icon" href="/apps/theming/favicon?v=0">

so something is still not good yet…

OK it looks like you are using the build in Theming app, which is different from the custom theme folder I have created (within the themes subfolder inside Nexcloud folder) in which you can define images, and if required also CSS files or templates.

From what I can see in the Theming app is that you can only set the logo (which will be visible in the web-page) and the login background.

Where did you set the favicon?

I am not using the built-in theme (from the admin web interface) but the one with it’s own directory /var/www/nextcloud/themes/mytheme

then I have configured the following parameter in my config.php file:

'theme' => 'mytheme'

Finally I have copied all my favicon files in /var/www/nextcloud/themes/mytheme/core/img

OK from the login page HTML code it shows it is using the build-in favicon.

all files/folders in the themes folder are the correct permission and ownership (www-data) ?

Also if you check as Admin the Theming section it does state: You are already using a custom theme ?

The permissions and owner/group are correct as you can below an ls -l of my mytheme/core/img directory:

-rw-r--r-- 1 www-data www-data  1503 Jan 16  2015 favicon.ico
-rw-r--r-- 1 www-data www-data  1363 Jun 20  2016 favicon-mask.svg
-rw-r--r-- 1 www-data www-data  1503 Jan 16  2015 favicon.png
-rw-r--r-- 1 www-data www-data 12469 Jan 16  2015 favicon.svg
-rw-r--r-- 1 www-data www-data  3631 Jan 16  2015 favicon-touch.png
-rw-r--r-- 1 www-data www-data  2957 Jan 16  2015 favicon-touch.svg

Also in the admin web interface I see the “You are already using a custom theme” message so it is really confusing.


I have the same Problem. The favicon.ico is copied to /themes/mytheme/core/img/favicon.ico
But in the Sourcecode from my Nextcloud show /core/img/favicon

Is it a BUG?

Yes, I can’t make it work, too. Did you find a solution, yet?
My theme favicon stopped working some versions ago, although it’s in the correct space.

I’ve been facing same problem after last update, when my theme was somehow disabled by it and when I enabled it again I couldn’t get my favicon back.

I found out it’s because it is cached somewhere. I edited lib/private/URLGenerator.php and in function imagePath I commented path retrieval from cache (lines 147 to 149). After page refresh, there it was, my favicon.

Don’t forget to undo all changes to this file afterwards.

Probably there is better way to achieve this.

1 Like

I ran into similar troubles with the favicon and resolved it by disabling the theming app.

From my observations, you can either use the themeing app or use your own theme in the themes/ folder, but having both activated at the same time may lead to unexpected behaviour (which seems to be caching issues at the first glance in my case).

1 Like

I didn’t use theming app and yet, when my theme was somehow disabled by the update, I had problems with favicon.

I can confirm that disabling the theming app solves the problem :slight_smile:
Didn’t think this could be the cause.

Should be reported in the theming-app-repository…

Looks like 13.0.3 will integrate this function with Advance Theming

Lets wait and see.