Migrated NextCloud to a Docker container but missing the apps

My NextCloud was running on Ubuntu on a VM now moved it to a Docker container.

Backed up Mysql restored to new Mysql container
Deployed new Redis server container
Deployed latest NextCloud v30 container and moved my data folder from old NC to new container mounted volume and performed an upgrade

Everything seems to be fine except my apps like Talk, Passwords, Music, Phonetrack don’t show up in the top menu. They show as installed but they are not. If I disable/enable them, they show up with all the data. However I delete the container and deploy it again the apps do not show up.

I confirmed that Mysql user has full permissions over the NC database.
Ran
occ db:add-missing-indices
occ maintenance:repair
occ integrity:check-core
occ files:scan --all produced:

On the Mysql
GRANT ALL PRIVILEGES ON nextcloud_database.* TO ‘nextcloud_user’@‘localhost’;
FLUSH PRIVILEGES;

No matter what I do, I have to disable the app which does not show up even I run occ app:list and re-enable it then it shows up

Can someone please let me know what else can be checked

1 Like
  • Which Docker image?
  • Please post your Compose file.

I’m using the latest image tag
i’m not using a custom image or Docker compose just direct deployment with mounting the SSL certs, php.ini, config and data folder with the container

1 Like

I’m using the latest image tag

Okay, but which image? There are numerous Nextcloud Docker images. Each have different volume structures.

i’m not using a custom image or Docker compose just direct deployment with mounting the SSL certs, php.ini, config and data folder with the container

Then post the run command.

If you’re using the micro-services image, be mindful that persist storage is expected to include more than just data/: (GitHub - nextcloud/docker: ⛴ Docker image of Nextcloud)

2 Likes

Do you mean I need also to mount the apps folder?
I did that but when the container run, the (default) apps folder from container overwrites the host apps folder and the apps do not show up again. Here’s how I deploy the container:

docker run -d --name NextCloud_CLOUD
–network macvlan_dmz
–ip 192.168.7.33
-v /home/NextCloud/DATA/NextCloud_CLOUD/data:/var/www/html/data
-v /home/NextCloud/DATA/NextCloud_CLOUD/config:/var/www/html/config
-v /home/NextCloud/DATA/NextCloud_CLOUD/apps:/var/www/html/apps
-v /home/NextCloud/DATA/NextCloud_CLOUD/SSL/certificate.crt:/etc/ssl/certs/certificate.crt
-v /home/NextCloud/DATA/NextCloud_CLOUD/SSL/private.key:/etc/ssl/private/private.key
-v /home/NextCloud/DATA/NextCloud_CLOUD/SSL/default-ssl.conf:/etc/apache2/sites-available/default-ssl.conf
-v /home/NextCloud/DATA/NextCloud_CLOUD/PHP/php.ini:/usr/local/etc/php/php.ini
–restart unless-stopped
nextcloud

1 Like
-v /home/NextCloud/DATA/NextCloud_CLOUD/data:/var/www/html/data
-v /home/NextCloud/DATA/NextCloud_CLOUD/config:/var/www/html/config
-v /home/NextCloud/DATA/NextCloud_CLOUD/apps:/var/www/html/apps 

Because you’re not handling /var/www/html/custom_apps, which is where all non-shipped apps get installed. For that matter, you’re not handling /var/www/html. If you’re going to separate things out, you need to cover all the folders as noted.

P.S. There is nothing wrong with mounting separate volumes for the various folders under /var/www/html - such as if you want to place them in different places - but from the looks of it you aren’t placing them in different places so you may want to consider streamlining things. You’re essentially doing this albeit using host folders rather than Docker managed volumes. But since you’re still just locating them all in /home/NextCloud/DATA/Nextcloud_CLOUD/ on your host, you’re just making your Docker setup more complicated without any change in the end result (and creating problems such as what this post brought up). Beware though if you change this you’ll need to be careful since you can’t just use /home/NextCloud/DATA/Nextcloud_CLOUD/ as-is for /var/www/html at the moment… since you’ve placed other non-Nextcloud managed stuff (SSL/ and PHP/) under it which will get wiped at update time. You’ll either need to tidy up your host folder structure (best IMO) or create yet another sub-folder (to contain /var/www/html and everything underneath it).

P.P.S Since I feel like I made that confusing (LOL), basically if you were starting from scratch I’d say do something like this:

docker run -d --name NextCloud_CLOUD
–network macvlan_dmz
–ip 192.168.7.33
-v /home/NextCloud/DATA/NextCloud_CLOUD/html:/var/www/html
-v /home/NextCloud/DATA/NextCloud_CLOUD/SSL/certificate.crt:/etc/ssl/certs/certificate.crt
-v /home/NextCloud/DATA/NextCloud_CLOUD/SSL/private.key:/etc/ssl/private/private.key
-v /home/NextCloud/DATA/NextCloud_CLOUD/SSL/default-ssl.conf:/etc/apache2/sites-available/default-ssl.conf
-v /home/NextCloud/DATA/NextCloud_CLOUD/PHP/php.ini:/usr/local/etc/php/php.ini
–restart unless-stopped
nextcloud
1 Like

Thanks man! You right, I was complicating things

I copied the apps, data, config to /html and mounted the html folder and everything worked as expected.

So is what I’m doing still what other do or I need to use Docker compose which I’m not familiar with? :face_exhaling:

Everytime I re-deploy the container, I must bash into the container to enable the ssl engine

a2enmod ssl
a2ensite default-ssl.conf
service apache2 restart

1 Like

You don’t need to use Compose. However it does make upgrades and changes easier as well as managing your entire stack as a cohesive thing (app + db + redis + cron containers).

If you’re scripting your run commands somehow yourself already, you may prefer your own approach though. It’s totally up to you.

Everytime I re-deploy the container, I must bash into the container to enable the ssl engine

This is the part you’re doing that is a bit unconventional.

That image is intended as a building block. Generally the HTTPS termination happens on a dedicated reverse proxy container in front of the it that handles HTTPS.

Or, if you insist on doing it within the app container like you essentially are, one customizes the image (by modifying the Dockerfile and/or entrypoint script) to include those changes you’re making permanently.

1 Like

I do have a reverse proxy that takes care of the SSL certificate including issuing and renewal.

Is the right way of doing it to avoid using the SSL in the container is, use SSL on the reverse proxy and only http between reverse proxy to container this way I do not enable SSL inside the container?

It’s probably fair to say it’s the more typical way, yes.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.