Info Security Memo
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org

Build Confidence

Focusing on Information Security 

Info Security Notes

Easiest Way to Deploy Your Own NextCloud with your Own Domain Using Portainer

11/23/2020

15 Comments

 
Easiest Way to Deploy Your Own NextCloud with your Own Domain Using Portainer

Nextcloud is a open-source suite of client-server software for creating and using file hosting services. There are many ways to  get it installed and here is my way to get it up and running as easiest as I can by using Docker. 


Create Your Cloud VM with Docker and Portainer Installed

1  Install Ubuntu or CentOS in the Cloud. Update it to latest.

Update and Upgrade Ubuntu to latest 

$ sudo apt-get -y update && sudo apt-get -y upgrade

2  Install Docker


For CentOS:

sudo -i
yum -y update
curl -sSL https://get.docker.com/ | sh
systemctl start docker.service
systemctl enable docker.service



For Ubuntu

sudo apt update
sudo apt upgrade
sudo apt install docker.io -y
sudo -i
systemctl start docker
systemctl enable docker
docker version


3  Install Portainer


docker volume create portainer_data
docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
docker ps

Use your browser to access URL http://<public ip of your linuxserver>:9000
First time, it will ask you to set up admin user's password.


Create Your Nginx Container




Nginx is using Bridge network. Restart policy is also set to Always. 

root@5fbe841d1f40:/etc/nginx/conf.d# apt-get update
root@5fbe841d1f40/etc/nginx/conf.d# apt-get install nano

Nginx configuration for Portainer docker. 

root@5fbe841d1f40:/etc/nginx/conf.d# cat portainer.conf 
server {
    listen       80;
    server_name  opc1portainer.51sec.org;

location / {
    proxy_pass       http://132.145.9.41:9000;
    proxy_redirect             off;
    proxy_http_version         1.1;
    proxy_set_header Upgrade   $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host      $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

Create Your NextCloud Container

1  Create NextCloud Container


2  Add tcp 8080 into your cloud firewall or security group

3  Add DNS A record for your nextcloud domain url

4  Configure Nginx to use your own domain to access your NextCloud site


root@5fbe841d1f40:/etc/nginx/conf.d# apt-get update
root@5fbe841d1f40/etc/nginx/conf.d# apt-get install nano

root@5fbe841d1f40:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
root@5fbe841d1f40:/# cd etc
root@5fbe841d1f40:/etc# cd nginx
root@5fbe841d1f40:/etc/nginx# cd conf.d
root@5fbe841d1f40:/etc/nginx/conf.d# ls
default.conf  portainer.conf  nextcloud.conf
root@5fbe841d1f40:/etc/nginx/conf.d# cat nextcloud.conf 
server {
    listen       80;
    server_name  nextcloud.51sec.org;


location / {
    proxy_pass       http://132.145.9.4:8080;
    proxy_redirect             off;
    proxy_http_version         1.1;
    proxy_set_header Upgrade   $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host      $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}
root@5fbe841d1f40:/etc/nginx/conf.d# 
5  Restart Nginx

Service Nginx Restart



Change NextCloud Config.php file to add trust domain

1  Accessing  your nextcloud through your own domain will get following error

2  Change config/config.php file to add a new trust domain : nextcloud.51sec.org

Snippet from config/config.php:
‘trusted_domains’ =>
array (
0 => ‘localhost’,
1 => ‘50.60.100.101’,
2 => ‘nextcloud.51sec.org’,
),


Testing access successful now using my own domain https://ift.tt/39aomm0. Here are some screenshots:











via Blogger https://ift.tt/2USqh67
November 23, 2020 at 08:12PM Cloud
15 Comments
korsan taksi link
11/13/2022 22:06:12

Tıkla: https://taksikenti.com/

Reply
ledger live link
11/20/2022 07:45:48

Ledger Live : Most trusted & secure crypto wallet

Reply
betinfo link
11/22/2022 18:58:35

It was a successful post.These types of posts are very helpful.

Reply
evden iş imkanı link
11/23/2022 20:36:10

Hemen Göz At evde para kazanmaya basla: https://sites.google.com/view/evden-ek-is/

Reply
mrbahis link
12/6/2022 17:39:23

Congratulations for the successful article. I can't wait for the sequel.

Reply
mrbahis link
12/8/2022 12:10:56

This is nice work. Seeing good works on good days gives one peace of mind.

Reply
vbet link
12/9/2022 07:21:10

Congratulations, it's a nice post. I'm always waiting for such nice posts in the future.

Reply
sportsbet link
12/10/2022 07:38:12

I follow your work closely. Congratulations for this beautiful content.

Reply
takipçi satın al link
12/11/2022 13:46:55

kaliteli düşmeyen takipçi satın al: https://takipcialdim.com/

Reply
tiktok takipçi satın al link
12/11/2022 15:43:34

Tiktok takipçi satın almak için tıkla: https://takipcialdim.com/tiktok-takipci-satin-al/

Reply
instagram beğeni satın al link
12/11/2022 15:46:49

İnstagram beğeni satışı yapan firmamıza göz atın: https://takipcialdim.com/instagram-begeni-satin-al/

Reply
sms onay link
12/17/2022 07:52:23

Hemen Göz At: https://www.smsonay.com/

Reply
takipçi satın al link
12/17/2022 07:55:32

uygun fiyatlardan takipçi Hemen Göz At: https://takipcim.com.tr/

Reply
casino siteleri link
12/29/2022 11:31:26

hemen göz at casino oyna: http://haikuboy.com

Reply
Sultanbeyli Çilingir link
8/22/2023 07:51:23

https://bit.ly/sultanbeyli-cilingir teşekkürler

Reply



Leave a Reply.

    Categories

    All
    Architecture
    Blog
    Checkpoint
    Cisco
    Cloud
    CyberArk
    F5
    Fortigate
    Guardium
    Juniper
    Linux
    Network
    Others
    Palo Alto
    Qualys
    Raspberry Pi
    Security
    SIEM
    Software
    Vmware
    VPN
    Wireless

    Archives

    March 2024
    February 2024
    January 2024
    December 2023
    November 2023
    October 2023
    September 2023
    August 2023
    July 2023
    June 2023
    May 2023
    April 2023
    March 2023
    February 2023
    January 2023
    December 2022
    November 2022
    October 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    October 2019
    September 2019
    June 2019
    July 2018
    May 2018
    December 2017
    August 2017
    April 2017
    March 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015
    April 2015
    March 2015

    Print Page:

    RSS Feed

    Email Subscribe
Powered by Create your own unique website with customizable templates.
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org