This guide describes the installation steps of Nextcloud server on Kapsi shared hosting service. It covers two methods: the first is based on usage of software with graphical user-interface and the other is focusing on command line usage. The first is suitable for beginners and the latter for more advanced Linux users. At the end there is one common addition to be made, it is described under Configuration title.
Installation using GUI:
- Go to Nextcloud download page.
- Click Download under the Get Nextcloud Server title.
- Select Web Installer (the link is located at middle of the lowest row of the popup window).
- Save the file on your computer (Step 1. in the instructions).
- Use FTPS client (Filezilla or similar) and open the connection to Kapsi server (Additional guidance in Finnish).
- Upload the setup-nextcloud.php file to /siilo/x/username/sites/yoursite-siilo.kapsi.fi/www/
- Open web browser and go to https://yoursite-siilo.kapsi.fi/setup-nextcloud.php, Nextcloud webinstaller appears to your screen.
- Click Next.
- If everything is ready for installation, the installer says: All Nextcloud dependencies found
- Here you can choose whether you want to install the software in a sub-folder or at the root of www -directory (in case just enter . to the box).
- Click Next.
- After few moments the installer says: Success, Nextcloud is now installed!
- Click Next.
- Create admin account by entering admin username and password.
- Click Storage & Database section, select MySQL/MariaDB
- Enter database information. Usually the database name and the user is same as your Kapsi username. The host address of Kapsi MySQL server is db1.n.kapsi.fi. If you do not have a personal password for database, you can ask for it from the Kapsi support (helpdesk@tuki.kapsi.fi).
- Installation is ready, see the configuration below.
Installation using CLI:
- Open terminal.
- Type
ssh username@kapsi.fi
- Enter your Kapsi password.
- Type
cd siilo/sites/yoursite-siilo.kapsi.fi/www
- Type
wget 'https://download.nextcloud.com/server/releases/nextcloud-12.0.3.tar.bz2'
(Check the latest version) - Type
tar xvfj
nextcloud-12.0.3.tar.bz2
- Open web browser and go to the Nextcloud location.
- Setup page appears, see the steps 10 -16 from GUI guide above.
- Installation is ready, see the configuration below.
Configuration
There are some adjustments to be done to make the internet traffic use https and allowing access from different ip-addresses if used with multiple devices. Open the .htacces file in installation directory. Add the following lines to the beginning of the file:
RewriteEngine on
RewriteCond %{ENV:HTTPS} !on
RewriteRule (.*) https://yoursite-siilo.kapsi.fi/$1 [R=301,L]
Then add the following lines to the very end of the file:
IndexIgnore *
<Limit GET POST PUT DELETE OPTIONS PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
order allow,deny
allow from all
</Limit>
In case you have security considerations related to this script that allows all traffic with all methods you may adjust your own setup which can be limited to particular ip-addresses or something else. However, even if all traffic is allowed, there is still the normal Nextcloud authentication system keeping the data safe from outsiders.
Now we are all set. Hope you enjoy your very own Nextcloud server!
Thanks a bunch! However, got stalled with the following error:
“Error while trying to create admin user: There is no column with name ‘remember’ on table ‘oc_authtoken’. ”
What to do?
Hi Marko,
Since creating an admin account is the first task using your newly configured database connection, my first consider is related to db connection. However, usually if there is a problem with the db connection, the error message would something like “Failed to connect to the database” or similar.
I checked that the “remember” column in the “oc_authtoken” table is a “small integer” data type, which should default to number “0”. I honestly do not have any idea what has gone wrong in your case. But did you try to setup everything again? And if yes, did you succeed?
If you cannot find a solution, this forum may be the next place to ask for further help.
Sorry for not having any clear resolution for you.
Thanks! This is awesome! Can I post this to the Kapsi UKK or to you want to that?
I have one question, if I login with admin and go to the settings, it says in the Security and setup warnings: “The “Strict-Transport-Security” HTTP header is not set to at least “15552000” seconds. For enhanced security, it is recommended to enable HSTS “
Any idea how to get rid of this message?
Thank you for your feedback! I may update this guidance in the future, thus it would be better to add a link to this original blog post. Please, feel free to do that.
That warning is telling you that you can add some additional security by restricting all the HTTP traffic in your site. Further guidance is provided here: https://docs.nextcloud.com/server/13/admin_manual/configuration_server/harden_server.html#enable-http-strict-transport-security
If possible it would be nice to have separate instruction for installing nextcloud to siilo when using own domain “example.com” with lets encrypt. There are bits and pieces available in the UKK and in this instruction that in combination make it possible (although difficult). But it would be truly helpful to make a version of these instructions for that scenario too.
Seems that the yoursite-siilo.kapsi.fi website is not configured by default to all kapsi users.
It need to be separately requested from the admin.
Hmm.. I cannot remember how it exactly was in my case but there is no mention about that in their guidance: https://www.kapsi.fi/palvelut/levytila.html
However, if you face any problems their support will help you out for sure.
I installed Nextcloud 19.0.1 yesterday. Using mySQL which has been used before. Having problems with uploading pictures. Uploading starts fine and some pictures get uploaded but then upload stalls and I get plenty of error boxes saying ‘An unknown error has occurred’.
Nextcloud log includes several fatal errors like this:
“Sabre\DAV\Exception\BadRequest: Expected filesize of 1012212 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 122880 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.”
I am using the new www backend of Kapsi.
Any ideas?