# Install plugins without direct access to github

**URL:** https://meta.discourse.org/t/install-plugins-without-direct-access-to-github/111718
**Category:** Support
**Tags:** unsupported-install
**Created:** [March 15, 2019, 4:24pm UTC](https://meta.discourse.org/t/install-plugins-without-direct-access-to-github/111718 "2019-03-15T16:24:10Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Bram\_van\_Oploo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bram_van_oploo/32/134149_2.png) [@Bram\_van\_Oploo](https://meta.discourse.org/u/Bram_van_Oploo)
#### Post date: [March 15, 2019, 4:24pm UTC](https://meta.discourse.org/t/install-plugins-without-direct-access-to-github/111718/1 "2019-03-15T16:24:11Z")

</div>

I’m installing Discourse (ditnami-discourse) within a very restricted environment. The VM has no access to github, for instance. The mechanism bitnami-discourse uses for plugin installation is:

```plaintext
RAILS_ENV=production bundle exec rake plugin:install repo=https://github_repo_url
RAILS_ENV=production bundle exec rake assets:precompile

```

Via an alternative route I’ve placed (cloned) the plugin repo’s in de plugins directory. Unfortunately (for me) “RAILS\_ENV=production bundle exec rake plugin:install” seems to do more then just clone the repo in the plugins directory. Because when I run “RAILS\_ENV=production bundle exec rake assets:precompile” the plugins are not being picked up. Is there an option to do something like ?:

```plaintext
RAILS_ENV=production bundle exec rake plugin:install path=./local_repo_for_plugin

```

Thank you in advance!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 15, 2019, 5:12pm UTC](https://meta.discourse.org/t/install-plugins-without-direct-access-to-github/111718/2 "2019-03-15T17:12:53Z")

</div>

> [@Bram\_van\_Oploo](#):
>
> I’m installing Discourse (bitnami-discourse) within a very restricted environment.

That’s why it’s not supported here. You can ask the good folks at Bitnami for help. People here will be glad to help if you follow [discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md).

---

<div class="post-metadata">

### Author: ![Bram\_van\_Oploo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bram_van_oploo/32/134149_2.png) [@Bram\_van\_Oploo](https://meta.discourse.org/u/Bram_van_Oploo)
#### Post date: [March 15, 2019, 5:15pm UTC](https://meta.discourse.org/t/install-plugins-without-direct-access-to-github/111718/3 "2019-03-15T17:15:44Z")

</div>

Thank you for your response.

I could have asked the exact same question if I was using the officially supported method. The installation method is not the issue. A way to install plugins without direct access to github is.

Edit: I might decide to use the official method in a later stage anyway. In that case the question remains the same.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 15, 2019, 5:20pm UTC](https://meta.discourse.org/t/install-plugins-without-direct-access-to-github/111718/4 "2019-03-15T17:20:02Z")

</div>

> [@Bram\_van\_Oploo](#):
>
> A way to install plugins without direct access to github is.

You just need to put a folder containing the plugin code in the `plugins` folder.

The yaml hook gives you full bash power so you can:

- `wget` a tarball with plugin code
- `rsync` from somewhere with plugin code
- `scp` it from another server
- `git clone` from a local gitlab install

etc.

---

<div class="post-metadata">

### Author: ![Bram\_van\_Oploo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bram_van_oploo/32/134149_2.png) [@Bram\_van\_Oploo](https://meta.discourse.org/u/Bram_van_Oploo)
#### Post date: [March 15, 2019, 5:23pm UTC](https://meta.discourse.org/t/install-plugins-without-direct-access-to-github/111718/5 "2019-03-15T17:23:13Z")

</div>

The github plugin repo clones are already in place within the plugins directory. They just aren’t picked up by the assets:precompile hook. I need an alternative way of running plugin:install, because I can’t provide a working repo url ([github.com](http://github.com) is blocked).

Edit: the machine doesn’t have access to any git server, unfortunately.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 15, 2019, 5:27pm UTC](https://meta.discourse.org/t/install-plugins-without-direct-access-to-github/111718/6 "2019-03-15T17:27:05Z")

</div>

> [@Bram\_van\_Oploo](#):
>
> plugin:install

`plugin:install` is not a thing for official Discourse.

The only official way to install plugins is the one we describe on every approved ™ install app.yml, and that has 0 problems with ordering of the precompile assets task.

---

<div class="post-metadata">

### Author: ![Bram\_van\_Oploo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bram_van_oploo/32/134149_2.png) [@Bram\_van\_Oploo](https://meta.discourse.org/u/Bram_van_Oploo)
#### Post date: [March 15, 2019, 5:31pm UTC](https://meta.discourse.org/t/install-plugins-without-direct-access-to-github/111718/7 "2019-03-15T17:31:32Z")

</div>

Ok. So if I use the official installation method, I can just place (rsync) git clones of the plugins into the /plugins directory, run assets:precompile, and the plugins will be installed? If that is the case I will try and find a way to use the supported method (which won’t be easy because of all the restrictions the machine has in place).

As I’ve said. I can’t access (or install) any git repositories on the VM.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 15, 2019, 5:36pm UTC](https://meta.discourse.org/t/install-plugins-without-direct-access-to-github/111718/8 "2019-03-15T17:36:05Z")

</div>

If you use the official way, there will be no need to manually run `assets:precompile`.

Just install the plugins in the same place the default plugin is installed and follow along.

> [@Bram\_van\_Oploo](#):
>
> As I’ve said. I can’t access (or install) any git repositories on the VM.

As said above there are a multitude of ways to get the code inside the container (wget, curl, rsync, scp). Since you are the only one familiar with the environment, you will have to pick the more appropriate one.

One thing you can do, is to bootstrap the docker container elsewhere (`./launcher bootstrap app` step in our official guide) and then move the resulting image into the server with restricted access and run the image from there. That will require some docker-fu, but in my experience those heavily restricted environments are all about making the every day to day tasks a lot harder anyway.

---

<div class="post-metadata">

### Author: ![Bram\_van\_Oploo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bram_van_oploo/32/134149_2.png) [@Bram\_van\_Oploo](https://meta.discourse.org/u/Bram_van_Oploo)
#### Post date: [March 18, 2019, 4:10pm UTC](https://meta.discourse.org/t/install-plugins-without-direct-access-to-github/111718/9 "2019-03-18T16:10:39Z")

</div>

Thank you for your support. I’ve created a bootstrapped image on a different machine (that does have access to github). I’ve pushed that image to our local Docker registry and pulled the image on the machine that can’t access github. When I try to run the image I still get the following error and the container won’t start. Anything I can do about that? I’m using the officially supported method now!

```plaintext
fatal: unable to access 'https://github.com/discourse/pups.git/': Could not resolve host: github.com

```

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 18, 2019, 4:14pm UTC](https://meta.discourse.org/t/install-plugins-without-direct-access-to-github/111718/10 "2019-03-18T16:14:06Z")

</div>

> [@Bram\_van\_Oploo](#):
>
> I try to run the image I still get the following error

How **exactly** are you trying to run the image?

---

<div class="post-metadata">

### Author: ![Bram\_van\_Oploo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bram_van_oploo/32/134149_2.png) [@Bram\_van\_Oploo](https://meta.discourse.org/u/Bram_van_Oploo)
#### Post date: [March 18, 2019, 4:50pm UTC](https://meta.discourse.org/t/install-plugins-without-direct-access-to-github/111718/11 "2019-03-18T16:50:34Z")

</div>

`docker run docker-registry.local/discourse/my-bootstrapped-image`

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 18, 2019, 5:39pm UTC](https://meta.discourse.org/t/install-plugins-without-direct-access-to-github/111718/12 "2019-03-18T17:39:10Z")

</div>

At the end of the `./launcher bootstrap` we print a complete run command that you should use to start the image, it’s like:

```plaintext
docker run --shm-size=512m -d --restart=always --name app -t -p 80:80 -p 443:443 -v /var/discourse/shared/standalone:/shared -v /var/discourse/shared/standalone/log/var-log:/var/log local_discourse/app /sbin/boot

```

Also, are you 100% sure you saved the bootstraped image to the local registry `local_discourse/app:latest` instead of the base image `discourse/base:2.0.20190217` ?

I was able to boot the app while disabling my network interface just fine.

---

<div class="post-metadata">

### Author: ![Bram\_van\_Oploo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bram_van_oploo/32/134149_2.png) [@Bram\_van\_Oploo](https://meta.discourse.org/u/Bram_van_Oploo)
#### Post date: [March 18, 2019, 10:55pm UTC](https://meta.discourse.org/t/install-plugins-without-direct-access-to-github/111718/13 "2019-03-18T22:55:44Z")

</div>

Thank you @Falco! I’ve got it working on a very restricted RHEL VM and a Ubuntu 18.04 VM with access to everything (for generating the image), using the supported installation method ([discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md)). The missing /sbin/boot command was what caused the [github.com](http://github.com) access error.

In summary and for documentation; the steps needed to create and image and run it on my server:

- Clone discourse:

```plaintext
git clone https://github.com/discourse/discourse_docker.git /var/discourse && cd /var/discourse

```

- Configure with default values

```plaintext
./discourse-setup

```

- Tweak the default discourse configuration (optional)

```plaintext
nano /var/discourse/containers/app.yml

```

- Get the local\_discourse/app IMAGE ID (something like **b6fa739cedf5** )

```plaintext
docker images -a

```

- Create your own tag for the image with the **IMAGE ID**

```plaintext
docker tag b6fa739cedf5 your-registry-url.com/namespace/image-name

```

- Push your image to your registry (you might need to login with **docker login [https://your-registry-url.com](https://your-registry-url.com)** first)

```plaintext
docker push your-registry-url.com/namespace/image-name

```

- On the server you’d like to create the discourse container, create a **docker-compose.yaml** file for your application (configure it to your specifications with something like…)

```plaintext
version: '3'

services:
  discourse:
    container_name: discourse_docker_custom
    image: 'your-registry-url.com/namespace/image-name:latest'
    restart: always
    shm_size: 512m
    command: /sbin/boot
    ports:
      - '80:80'
      - '443:443'
    volumes:
      - '/shared:/var/discourse/shared/standalone'
    environment:
      - DISCOURSE_DEVELOPER_EMAILS=admin@email-address.com
      - DISCOURSE_SMTP_AUTHENTICATION=none
      - DISCOURSE_SMTP_OPENSSL_VERIFY_MODE=none
      - DISCOURSE_SMTP_ADDRESS=localhost
      - DISCOURSE_SMTP_PORT=25
      - DISCOURSE_SMTP_USER_NAME=
      - DISCOURSE_SMTP_PASSWORD=
      - DISCOURSE_SMTP_ENABLE_START_TLS=true
      - DISCOURSE_HOSTNAME=your.server.com
    networks:
      - discourse

networks:
  discourse:
    driver: bridge

```

- Install **docker-compose** ([Overview of installing Docker Compose | Docker Docs](https://docs.docker.com/compose/install/)) and run (within the directory that contains the docker-compose.yaml file):

```plaintext
docker-compose up -d

```

…and you’ll be up and running.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 17, 2019, 10:55pm UTC](https://meta.discourse.org/t/install-plugins-without-direct-access-to-github/111718/14 "2019-04-17T22:55:46Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
