最后更新于
最后更新于
Next Cloud官网:
官方服务端安装页面:
推荐方法1:
通过Web Server PHP安装,非常简单小白
官方介绍(我直接复制过来的,链接也都在):
Web installer
The Web Installer is the easiest way to install Nextcloud on a web space. It checks the dependencies, downloads Nextcloud from the official server, unpacks it with the right permissions and the right user account. Finally, you will be redirected to the Nextcloud installer.
Right-click and save the file to your computer
Upload setup-nextcloud.php to your web space
Point your web browser to setup-nextcloud.php on your webspace
Follow the instructions and configure Nextcloud
Login to your newly created Nextcloud instance!
You can find further instructions in the .
Note:
Installer uses the same Nextcloud version as available for the built in updater in Nextcloud. After a major release it can take up to a month before it becomes available through the web installer and the updater. This is done to spread the deployment of new major releases out over time.
为了防止你不知道下载链接在哪(还真有这样的小笨蛋),我再额外放一下:
推荐方法2:
通过Web Server Archive安装,原理跟上面那个一样,但是你要上传的就不只是一个PHP文件了,你要上传一个zip压缩包然后在服务器上解压,官方介绍如下:
Archive
Nextcloud Server does not support Microsoft Windows. We recommend using a virtual machine or docker image on Windows Server.
Security Note:
Release Channels:
推荐方法3:
上面的两种方法都要用要Web Server服务,如果你之前装了宝塔面板那就非常方便,直接建个网站把上面两个步骤的任意一个文件丢上去自动构建就行,宝塔面板也有解压服务。
但是如果你没装宝塔面板,就会比较麻烦,建议用这第三个方法,Docker安装:
官方介绍:
ALL-IN-ONE DOCKER IMAGE
Emm,貌似说了等于没说,但是其实上面给的这个Github页面里说的很详细,可以直接去Github看,为了方便不想看英文的,我直接把docker安装的核心代码放这里:
实际服务器端输入大概率是不能换行的(因为换行就相当于回车,一个换行直接就运行了),直接在同一行打就行,我这边直接给了:
sudo docker run --init --sig-proxy=false --name nextcloud --restart always --publish 80:80 --publish 8080:8080 --publish 8443:8443 --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config --volume /var/run/docker.sock:/var/run/docker.sock:ro nextcloud/all-in-one:latest
另外官方还写了几个注意事项:
After the initial startup, you should be able to open the Nextcloud AIO Interface now on port 8080 of this server.
E.g.
If your firewall/router has port 80 and 8443 open/forwarded and you point a domain to your server, you can get a valid certificate automatically by opening the Nextcloud AIO Interface via:https://ip.address.of.this.server:8080
https://your-domain-that-points-to-this-server.tld:8443
Please do not forget to open port and in your firewall/router for the Talk container!3478/TCP 3478/UDP
简单来说就是访问ip:8080来访问Next Cloud服务,并且要确保防火墙放行80、8080、8443、3478端口
主要就是这三种安装方法了,再总结一下就是有宝塔用前两个,没有就用第三个,什么你连docker都没有?那别玩服务器了哥
第一:后台任务 (有失败概率)
Next Cloud的后台任务执行方式分为三种,AJAX、Webcron、Cron
默认是AJAX即在每次访问Nextcloud任意页面都会通过AJAX的方式发起定时任务的执行请求,这种方式如果没有自己的独立服务器或者VPS的话还是比较方便省心的
但官方推荐使用Cron,和Nginx或Apache等WEB服务独立开来,互不影响
在Nextcloud设置 — 基本设置里,选择为 Cron
然后SSH连接到服务器,添加crontab定时任务
crontab -e
添加一行,并保存
*/5 * * * * sudo -u www php -f /www/wwwroot/example.com/cron.php
注意把这里的网站改成你的
有宝塔面板的话可以直接去宝塔创建Cron服务,还是挺简单的。
第二:内存缓存
通过使用内存作为数据缓存的话,可以提高Next Cloud的性能,以加快WEB端的访问速度,并且Nextcloud支持多个内存缓存后端,如APCu、Redis、Memcached
安装PHP的APCu+Redis扩展配置 (在宝塔面板)
安装完毕后,打开/www/wwwroot/example.com/config/config.php,
在其尾部添加以下代码
第三:开启HTTP2
宝塔面板安装的Nginx默认已支持http2,直接跳过此步即可
服务器命令:
[root@ali-sg ~]# nginx -V
nginx version: nginx/1.16.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)
built with OpenSSL 1.1.1b 26 Feb 2019
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/www/server/nginx --with-openssl=srclib/openssl --add-module=srclib/ngx_devel_kit --add-module=srclib/lua_nginx_module --add-module=srclib/ngx_cache_purge --add-module=srclib/nginx-sticky-module --add-module=srclib/nginx-http-concat --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_gunzip_module --with-stream --with-stream_ssl_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --with-ld-opt=-Wl,-E --with-pcre=srclib/pcre-8.42
第四:优化PHP-FPM参数
这里也是需要根据自身服务器环境进行设置,不过基本的前提就是并发量足够大,内存就要足够大
宝塔的配置文件路径在 /www/server/php/73/etc/php-fpm.conf
Next Cloud官方给的参数是
宝塔面板上可以很方便的进行PHP-FPM参数设置
第五:开启PHP OPcache
通过安装OPcache扩展,也可以在一定程度上提升PHP的性能
直接参考上面的文档即可,全都是图我就不整理了,要是作者删了那。。。也没办法
The archive should be extracted in a folder your web server has access to. Latest stable version: see . Follow the installation chapter. If you already run Nextcloud, refer to the .
Download the or archive.
Check package integrity using MD5 ( / ) or SHA256 ( / )
Verify the authenticity via PGP (/). The Nextcloud GPG key . You can also grab the keys by issueing this command:
gpg --keyserver keys.openpgp.org --recv-keys 28806A878AE423A28372792ED75899B9A724937A
You can already find server packages included with many distributions or provided by active community members. Find an Can’t find packages you need? Ask your distribution for packages or contribute to creating them!
Looking for
To receive information about updates and security issues, we recommend a subscription to our low-traffic newsletter .
We offer with production, stable, beta and daily-branches. This gives you the opportunity to choose your balance between stability and features. Most of our Appliances support these release channels or let you fix on specific major versions.
为了防止你不知道下载链接在哪(还真有这样的小笨蛋),我再额外放一下:
Nextcloud GmbH maintains an all-in-one Docker image that is easy to install and maintain. You can get further information about this project on its .
Note: You may be interested in adjusting Nextcloud’s datadir to store the files in a different location than the default docker volume. See on how to do it.
本教程主要来自于CSDN:
Next Cloud官方优化文档(英文):
这里以APCu+Redis为例,并且官方推荐的缓存组合就是APCu和Redis,其他的缓存后端配置请参阅:
本教程主要来自腾讯云社区:
最好用的服务器端云存储管理器!我说的!