Docker installation in Ubuntu 20.04

I am totally new to Docker and Ubuntu but even though i have to install Nextcloud!
Based on the example of github i ran Nextcloud in a container.

After that i could access Nextcloud at localhost.
I made a mistake with the Wizard and i left SQLite as a db and not MariaDB.
So, my first issue is that when i am trying to the command “php occ db:convert-type [options] type username hostname database” as shown in the documentation i have a message that “could not open input file:occ”.

I have also some other issues like “Accessing site insecurely via HTTP” and “You are accessing your instance over a secure connection, however your instance is generating insecure URLs”.

I have made a whole day research but whichever command i may write has error or an issue. I think that the problem is me, because i dont know how Docker is working and i am i the same point one day with no progress.

I would appreciate for a help.

1 Like

what is your primary aim? a working nextcloud instance or learning docker?

to answer your question about runing a php command:

sudo docker exec --user www-data nextcloud php occ  ...

will/should do the job.

but maybe you just want to remove everything and start over again:

sudo docker ps      # will display all running container
sudo docker stop $(sudo docker ps -a)   # will stop all container
sudo docker rm $(sudo docker ps -a) # will remove all container
sudo docker volume ls   # will show you all data volumes
sudo docker rm $(sudo docker volume ls)   # will remove all data volumes

more less. didn’t test the exact spelling.

if you read carefully the docs and use the environment variables you maybe able to skip the initial setup page and have the database connection configure automatically. <- " Auto configuration via environment variables"

1 Like

@Ntinos I wrote a guide for doing this on Ubuntu 18.04 and Nextcloud 18. There may be a couple minor differences, but it’s basically the same.

On the note about OCC, be aware that you need to execute that inside the container, not on the host OS. I have an easy fix for that in my guide as well.

Thanx a lot for your reply.
My primary aim is a working nextcloud for my work. I am trying to install in a linux server the nextcloud in order our clients to have access for their files.
I am totally confused…

Is it possible to guide me step by step or is it too much for you?

Thanx for your reply.
I did it but when i tryed to make the virtual host setup, nothing happened. It opened a new window in my terminal with no actions. Maybe its because of my awareness…

I really don’t understand what you mean by that.

@KarlF12 no worries. I just installed Nextcloud.
Do you know how can i access it from two diferrent internal networks?
192.x.x.x/24 and 172.x.x.x/24
I think with the occ command i can whitelist different networks. I tried to do that but this occ command didnt found

You can access it from any routable network as long as it isn’t blocked by a firewall or misconfigured NAT. There’s no need to whitelist particular IP ranges in Nextcloud itself.