Tag: Portainer

  • How to Set up Nextcloud with Richard Applegate Repo with Portainer?

    So easy, I recommend you guy to do use Repo and then enjoy the services you use.

    1. Open my git repo Nextcloud to copy all the environment variables, or you will get an error.
    2. Go to your Portainer site, then go to create stack.
    3. click git repo, and copy and paste my Nextcloud repo, https://gitlab.richardapplegate.io/docker/nextcloud.git
    4. Scroll Down until Environments variables and paste all environment variables
    5. Start the services and go check your Nextcloud http://yourIP:Port
    6. If you want proxy Services Coming soon for tutorial.

  • How to set up MariaDB with Portainer Stacks +(Docker-compose)

    We’re using MariaDB for our business because it’s meant for big business, and it’s my favorite database to use for small businesses. And I have a lot of skill experience with MariaDB than any other database, but few other databases are lacking in my experience. Therefore, I do not have sufficient time to undertake these experiences. After I document all my notes and work for sure, I will study these (MongoDB, PostgreSQL) I use some on app after I document all my notes and work for sure. I will study these after I document all my notes and work for sure. Which is a pain for me, but I got the app working and stable. So let get start to Tutorial for MariaDB.

    Please ensure that you complete this first. Before starting build this,

    How to set up Portainer with nginx Proxy Manager

    We need to create a network for the MariaDB database for another app to communicate. We prefer to refrain from exposing our port.

    docker network create mariadb

    Now we can begin to create details for the MariaDB Database on Portainer.

     version: '2'
    services:
      mariadb:
        container_name: mariadb
        networks:
          - mariadb
        image: mariadb
        command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
        restart: always
        environment:
          - MYSQL_ROOT_PASSWORD=yourownpassword
          - MARIADB_AUTO_UPGRADE=1
          - MARIADB_DISABLE_UPGRADE_BACKUP=1
        volumes:
          - /mnt/nasdrive/mariadb/:/var/lib/mysql
    networks:
      mariadb:
        external: true

    Then you deploy the stacks. Your app will then be operational. Thereafter, you can easily add PhpMyAdmin to this docker-compose. But I like stacks because we can use the same app for many server databases.

    OPTIONAL BONUS for PhpMyAdmin How to set up.

  • How to set up PhpMyAdmin with MariaDB on Portainer with NGINX Proxy Manger.

    PhpMyAdmin is easy to set up for any app and fix the table database or troubleshoot. So, we will set up PhpMyAdmin with NGINX SSL secure for our HTTPS. Due to the possibility of a grabber username and password exploit, we would prefer not to expose this on HTTP.

    Please ensure that you complete this first. Before starting, we should make sure that this tutorial prevents hacking and exposes our port to the public. We do not want that to happen. We only want 80 and 443 to be open.

    How to set up Portainer with nginx Proxy Manager

    After you complete Portainer and nginx, we are good to go to build this app with nginx and PhpMyAdmin.

    Open Portainer → Stacks→ create stacks

    version: '3'
    services:
      pma:
        networks:
          - nginx
          - mariadb
        image: phpmyadmin/phpmyadmin
        container_name: pma
        environment:
          PMA_ARBITRARY: 1
        restart: always
        #ports:
         # - 8081:80
    networks:
      nginx:
        external: true
      mariadb:
        external: true

    I put hashtags on ports and port numbers because we don’t need them. We’ll just use nginx network on this app. Nginx proxy can talk to PhpMyAdmin instead of port or public. It is more secure to build our app before it is published to the public. Your sites can be injected with any insecure port.

    After deploying the stacks, your PhpMyAdmin is now online, but it won’t show up on the site because you didn’t set up the nginx proxy info. That would be our next step.

    You should open the nginx proxy manager for your site. My will be nginx__.richardapplegate.io.

    Thereafter, you’ll need to access your admin account. Add proxy host, then fill this detail.

    I configured the PMA to forward hostname/IP as a result of setting docker-compose on the PhpMyAdmin container_name to the PMA. And this app uses 80 ports on the NGINX network.
    Make sure you enable SSL and HTTP/2 and HSTS.

    Now you may be able to open your site with a domain without port. My will be phpmyadmin.richardapplegate.io. and working!

    Server: your database container_name on docker-compose. Mine is mariadatabase
    Username: your primary account for all database control. Mine is root.
    Password: you create the password and the password should on your docker-compose. You won’t be possible to log in my PhpMyAdmin because 3 times incorrect information, then you will be banned. You won’t access from my server or see my sites anymore for 1 week.

    You’re in the MariaDB database.

    “SSL is not being used” is normal because itself PhpMyAdmin is not on public, it is on nginx proxy manager. So, PhpMyAdmin is not public, it is full secured under the nginx. And you can see that we can create databases or tables or control user accounts.
  • How to set up Baserow on Portainer with nginx proxy manager

    This baserow is my absolute favorite, it’s more like a spreadsheet with more options and an easy-to-use database. It also had a Grid and Form and a Gallery and a Calendar! It’s great for our list of things to do.

    Look over Baserow.io!

    You’ll need Portainer and nginx running, remember? If not, here are my instruction to set up on your server.

    Let’s build stacks now.

    Open Portainer site → stacks → add stacks

    version: "3.4"
    services:
      baserow:
        container_name: applegate-baserow
        image: baserow/baserow:1.24.2
        networks:
          - nginx
          - mariadb
        environment:
          BASEROW_PUBLIC_URL: 'https://sub.domain.com'
        volumes:
          - /yourpath/baserow/data:/baserow/data
    networks:
      nginx:
        external: true
      mariadb:
        external: true
        

    Before you deploy, please ensure you follow the high light and modify and edit the networks to match your nginx proxy manager and MariaDB Database Network. Then, deploy the stack and this app is online but not show on site. We need to go to nginx proxy manager to set up a proxy host for baserow.

    Scheme – HTTP
    Forward Hostname – Your container_name here
    Forward port – Expose 80 to here.
    ensure to enable SSL and HTTP/2 and HSTS

    The sign-up form should appear when you open the base row. Please complete it for the first user, and this account will provide you with an admin account.

  • Nextcloud After Update and get this Error Message. I am Use Portainer, Docker.

    Nextcloud After Update and get this Error Message. I am Use Portainer, Docker.

    Error Message:

    Go to Portainer Web and log in with your admin account. Then select the correct environment server. Then go to Nextcloud Container to enter the console.

    Please make sure you change the user root to www-data, then connect.

    Now you can see that you have a terminal on your webgui and fill out this command line.

    php occ db:add-missing-indices
    Sucess and now Error gone.

    Before:

    After

  • How to set up the Collabora office with portainer and Nginx.

    My goal to make my Nextcloud to become Google Workspace because my goal is our data most important to privacy with our data sensitive. And I would like to purchase free instead of paid Google Workspace because we have our server, and we use it for IT documents and resources.

    So, you need to make sure nginx proxy manger and Portainer Up running before we start this.

    We do not need to create a network because we already did created with nginx proxy manager (nginx)

    Portainer sites → login admin account → stacks → add stacks

    version: '2'
    services:
       applegateoffice:
         container_name: collabora
         image: collabora/code:latest
         restart: always
         expose:
           - 9980
         cap_add:
           - MKNOD
         networks:
           - nginx
         environment:
           - username=yourusername
           - password=yourpassword
           - aliasgroup1=https://yoursubdomain.yourdomain.io
           - aliasgroup2=https://yoursubdomain.yourdomain.io
           - extra_params=--o:net.proto=IPv4
    
    
    networks:
      nginx:
        external: true

    Start the deployment and go to nginx proxy manager to add proxy host detail.

    Advanced Custom Nginx Configuration

    # static files
    location ^~ /loleaflet {
      proxy_pass $forward_scheme://$server:$port;
      proxy_set_header Host $http_host;
    }
    
    # WOPI discovery URL
    location ^~ /hosting/discovery {
      proxy_pass $forward_scheme://$server:$port;
      proxy_set_header Host $http_host;
    }
    
    # main websocket
    location ~ ^/lool/(.*)/ws$ {
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_http_version 1.1;
      proxy_pass $forward_scheme://$server:$port;
      proxy_set_header Host $http_host;
      proxy_read_timeout 36000s;
    }
    
    # download, presentation and image upload
    location ~ ^/lool {
      proxy_pass $forward_scheme://$server:$port;
      proxy_set_header Host $http_host;
    }
    
    # Admin Console websocket
    location ^~ /lool/adminws {
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_http_version 1.1;
      proxy_pass $forward_scheme://$server:$port;
      proxy_set_header Host $http_host;
      proxy_read_timeout 36000s;
    }

    Once the configuration has been saved, proceed to open the newly created domain.

    Now we go over the Nextcloud

    Save and your sites are now in collaboration with the office.

  • How to set up Portainer with nginx Proxy Manager.

    Step 1 – Setting up Docker and Portainer

    Before we start, you will need to install Docker and Docker-Compose on your Linux server before we can start this.

    Install Docker Engine on Ubuntu | Docker Documentation

    Since we don’t have one in the active tutorial, we have to create Portainer on Docker Compose in SSH Terminal instead of Portainer WebGui, since we don’t have one.

    1. I am not using Docker Volumes to save our data, so create the folder where you want to save because I am not using Docker Volumes for a reason.

    mkdir /mnt/nasdrive/portainer/ && mkdir /mnt/nasdrive/nginx 

    2. In the SSH terminal, create the network for nginx.

    docker network create nginx

    3. Please go to the folder you created for Portainer and create the file docker-compose.yml.

    cd /mnt/nasdrive/portainer && touch docker-compose.yml

    4. Here’s my configure docker-compose.yml.

    version: '3.3'
    services:
      portainer:
        image: portainer/portainer-ce:latest
        container_name: portainer
        ports:
          - 8000:8000
          - 9443:9443
        networks:
          - nginx
        command: -H unix:///var/run/docker.sock
        restart: always
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock
          - /mnt/nasdrive/portainer/data:/data
    networks:
      nginx:
       external: true

    5. Now that the Portainer is up and running, we can start to use it. To make my site secure and HTTPS with let’s encrypt, we need to create Let’s encrypt on Portainer. I already have and made an account. You should expect to see a first time creation of an account. https://yourIP:port

    Now, you can log in to Portainer to start creating a docker nginx proxy manager.

    Step 2 – setting up nginx proxy manager

    1. After selecting the Server for your initial Portainer Docker, you will notice the option “Stacks” on the front page of Portainer. To add a stack, click the blue button.

    2. You can choose any name you want, but it’s helpful for me to keep things organized. We made a program called nginx__. I use compose docker configure, but we have MariaDB Database separate docker compose because I want to use one database for all my General apps. If you desire to utilize the MariaDB database, the following tutorial provides guidance on setting up the database on Portainer.

    version: '3.8'
    services:
      app:
        container_name: nginx
        image: 'jc21/nginx-proxy-manager:latest'
        restart: unless-stopped
        networks:
          - nginx
          - mariadb
        ports:
          - target: 443
            published: 443 # Outside port
            mode: host
            protocol: tcp
          - target: 80
            published: 80 # Outside port
            mode: host
            protocol: tcp
          - target: 81
            published: 81
            mode: host
            protocol: tcp
        environment:
          # Mysql/Maria connection parameters:
          DB_MYSQL_HOST: "mariadb"
          DB_MYSQL_PORT: 3306
          DB_MYSQL_USER: "npm"
          DB_MYSQL_PASSWORD: "Password"
          DB_MYSQL_NAME: "npm"
          # Uncomment this if IPv6 is not enabled on your host
          DISABLE_IPV6: 'true'
          TZ: 'America/Los_Angeles'
        volumes:
          - /mnt/nasdrive/nginx/data:/data
          - /mnt/nasdrive/nginx/letsencrypt:/etc/letsencrypt
    networks:
      nginx:
        external: true
      mariadb:
        external: true

    I already created a MariaDB database and a user for the NGINX proxy manager. So easy with PhpMyAdmin method instead, terminal console. Learn more about set up PhpMyAdmin!

    3. Launching the stack for nginx!

    Now open the Docker Nginx Proxy Manager at http://yourIP:81.

    There is a default login because there is no creation page for users.

    Email: admin@example.com Password: changeme
    Immediately after logging in with this default user, you will be asked to modify your details and change your password.

    After you change the password and Username you set, then now you should see this:

    You should be said “0 Proxy Hosts”. I just have many domains here to use all my apps.

    Now you can open the Proxy hosts to make HTTPS certificates for NGINX proxy manager and Portainer.

    Nginx Proxy Manager – Nginx Proxy Host Detail

    This for Nginx proxy Manager. That form you should fill out. Just a reminder, the Forward hostname/IP can work with docker-compose “container_name: nginx”.
    You see docker-compose.yml have container_name: that you create, and container_name needs to be on form where is Forward Hostname/IP. So that way this machine can communicate with container_name to more secure because never know IP changed.
    Last, for nginx proxy Manager – Force SSL and HTTP2 and HSTS need to be enabled.
    Now, our sites are secure, and you have to remove port 81 on docker-compose to secure our HTTP. We will never expose 80 or 81, but our nginx proxy manager needs port 80 for Let’s Encrypt. So, we leave port for 80 and 443 on our docker-compose.yml.

    Portainer – Nginx Proxy Host Detail

    Portainer – scheme for HTTPS and port for 9443 and make sure you enable block common exploits and Web sockets support.
    Portainer – you will need to enable SSL and HTTP/2 and HSTS.

    Advanced custom nginx configurations won’t be needed anymore. Then now your Portainer and NGINX are secured!

    HTTPS on Portainer sites. 🙂

    I recommend you all to force HTTPS only on private network too. It’s really safe. So, the Portainer itself app will not work with the HTTP port anymore.

    Portainer ⇾ settings ⇾ scroll down until you see SSL Certificate