# Installing Primero v2 for development on Ubuntu 18.04

**URL:** <https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300>\
**Category:** Primero IMS\
**Tags:** v2-0\
**Created:** [March 20, 2020, 8:22pm UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300 "2020-03-20T20:22:26Z")\
**Posts on this page:** 16\
**Page:** 2

<div class="post-metadata">

**Author:** ![omgalvan.86](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/o/e8c25b/32.png) [@omgalvan.86](https://primero.supporthub.dev/forum/u/omgalvan.86)\
**Post date:** [May 11, 2020, 9:42pm UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300/22 "2020-05-11T21:42:53Z")

</div>

So I tried this again on a fresh system. I installed docker and docker-compose as indicated in the docker site, used Ruby 2.6.6 as required by Primero’s Gemfile, and installed node 14.2. Doing this I didn’t see any errors, either about missing dependencies or whatnot as I did before.

But it’s still not working. I’m seeing the same blank page, with the same error log as before. I also tried the following:

```auto
$ rails s
warning: parser/current is loading parser/ruby26, which recognizes
warning: 2.6.2-compliant syntax, but you are running 2.6.6.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
=> Booting Puma
=> Rails 5.2.4 application starting in development 
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 4.3.1 (ruby 2.6.6-p146), codename: Mysterious Traveller
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
I, [2020-05-11T21:35:42.105172 #19484] INFO -- : Started GET "/" for <My IP goes here> at 2020-05-11 21:35:42 +0000
I, [2020-05-11T21:35:42.160958 #19484] INFO -- : Processing by HomeController#v2 as HTML
I, [2020-05-11T21:35:50.749262 #19484] INFO -- : Completed 200 OK in 8588ms (Views: 8587.0ms | ActiveRecord: 0.0ms | Solr: 0.0ms)

```

```auto
$ npm run dev

> primero@ dev /home/martin/primero
> webpack-dev-server --config webpack/index.js

ℹ ｢wds｣: Project is running at http://localhost:9000/
ℹ ｢wds｣: webpack output is served from http://localhost:9000/
ℹ ｢wds｣: Content not from webpack is served from /home/martin/primero/public/packs
ℹ ｢wds｣: 404s will fallback to /index.html
Browserslist: caniuse-lite is outdated. Please run next command `npm update`
ℹ ｢wdm｣: wait until bundle finished: /application.json
ℹ ｢wdm｣: Child
       75 modules
Child
       8248 modules
ℹ ｢wdm｣: Compiled successfully.

```

development.log shows:

```auto
D, [2020-05-11T21:34:27.497285 #19484] DEBUG -- : SystemSettings Load (0.9ms) SELECT "system_settings".* FROM "system_settings" ORDER BY "system_settings"."id" ASC LIMIT $1 [["LIMIT", 1]]
D, [2020-05-11T21:34:27.524336 #19484] DEBUG -- : (0.5ms) SELECT default_locale FROM system_settings LIMIT 1
I, [2020-05-11T21:34:27.719460 #19484] INFO -- : Generating locations JSON file on server boot
D, [2020-05-11T21:34:27.762596 #19484] DEBUG -- : (1.0ms) SELECT COUNT(id) FROM locations
D, [2020-05-11T21:34:27.763687 #19484] DEBUG -- : (0.8ms) SELECT COUNT(id) FROM system_settings
I, [2020-05-11T21:35:42.105287 #19484] INFO -- : Started GET "/" for <My IP goes here> at 2020-05-11 21:35:42 +0000
I, [2020-05-11T21:35:42.161049 #19484] INFO -- : Processing by HomeController#v2 as HTML
I, [2020-05-11T21:35:50.749341 #19484] INFO -- : Completed 200 OK in 8588ms (Views: 8587.0ms | ActiveRecord: 0.0ms | Solr: 0.0ms)

```

@irlawrence can you try the installation yourself on a new system and see if we’re doing something wrong?

The strange thing is that app/assets/images/favicon-16x16.png does exist, as well as public/favicon.ico.

---

<div class="post-metadata">

**Author:** ![irlawrence](https://primero.supporthub.dev/forum/user_avatar/primero.supporthub.dev/irlawrence/32/8_2.png) [@irlawrence](https://primero.supporthub.dev/forum/u/irlawrence)\
**Post date:** [May 12, 2020, 11:52am UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300/23 "2020-05-12T11:52:41Z")

</div>

Ok, I will try a new install.  
If it were a server side problem then there wouldn’t be a blank page, there would be a failed request so what do your browser developer tools say?  
Turn off all extensions and then open an incognito window, then more tools → developer tools on chrome, then load the page and look at the console output

---

<div class="post-metadata">

**Author:** ![irlawrence](https://primero.supporthub.dev/forum/user_avatar/primero.supporthub.dev/irlawrence/32/8_2.png) [@irlawrence](https://primero.supporthub.dev/forum/u/irlawrence)\
**Post date:** [May 12, 2020, 6:21pm UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300/24 "2020-05-12T18:21:33Z")

</div>

I just used 2.6.6 and it loaded.  
Also what happens if you go to [http://0.0.0.0:3000](http://0.0.0.0:3000) and not localhost?

---

<div class="post-metadata">

**Author:** ![omgalvan.86](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/o/e8c25b/32.png) [@omgalvan.86](https://primero.supporthub.dev/forum/u/omgalvan.86)\
**Post date:** [May 12, 2020, 10:14pm UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300/25 "2020-05-12T22:14:34Z")

</div>

That’s odd. The Chrome console is showing the following:

![Screenshot from 2020-05-12 19-10-17](https://primero.supporthub.dev/forum/uploads/primero/original/1X/ace6f6b0ad34230cb9f2234fe1aa533b7566b5f2.png)

Using 0.0.0.0:3000 shows me the same blank page. As for whether this is a server side problem, what about this exception?

```auto
22:09:58 web.1 | F, [2020-05-12T22:09:58.812405 #26003] FATAL -- : actionpack (5.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call'
22:09:58 web.1 | actionpack (5.2.4) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
22:09:58 web.1 | railties (5.2.4) lib/rails/rack/logger.rb:38:in `call_app'
22:09:58 web.1 | railties (5.2.4) lib/rails/rack/logger.rb:28:in `call'
22:09:58 web.1 | actionpack (5.2.4) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
22:09:58 web.1 | actionpack (5.2.4) lib/action_dispatch/middleware/request_id.rb:27:in `call'
22:09:58 web.1 | rack (2.0.8) lib/rack/method_override.rb:22:in `call'
22:09:58 web.1 | rack (2.0.8) lib/rack/runtime.rb:22:in `call'
22:09:58 web.1 | actionpack (5.2.4) lib/action_dispatch/middleware/executor.rb:14:in `call'
22:09:58 web.1 | actionpack (5.2.4) lib/action_dispatch/middleware/static.rb:127:in `call'
22:09:58 web.1 | rack (2.0.8) lib/rack/sendfile.rb:111:in `call'
22:09:58 web.1 | railties (5.2.4) lib/rails/engine.rb:524:in `call'
22:09:58 web.1 | puma (4.3.1) lib/puma/configuration.rb:228:in `call'
22:09:58 web.1 | puma (4.3.1) lib/puma/server.rb:681:in `handle_request'
22:09:58 web.1 | puma (4.3.1) lib/puma/server.rb:472:in `process_client'
22:09:58 web.1 | puma (4.3.1) lib/puma/server.rb:328:in `block in run'
22:09:58 web.1 | puma (4.3.1) lib/puma/thread_pool.rb:134:in `block in spawn_thread'

```

Is that related to the missing favicon?

---

<div class="post-metadata">

**Author:** ![irlawrence](https://primero.supporthub.dev/forum/user_avatar/primero.supporthub.dev/irlawrence/32/8_2.png) [@irlawrence](https://primero.supporthub.dev/forum/u/irlawrence)\
**Post date:** [May 13, 2020, 11:08am UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300/26 "2020-05-13T11:08:03Z")

</div>

As a sanity check - you are running all of this on the same machine right, not a virtual machine?  
Do you have this line in /etc/hosts

```auto
127.0.0.1 localhost

```

Other things to check for the [connection refused](https://www.clickssl.net/blog/err_connection_refused-in-chrome) are:

- Browser extensions or software clashing with browser
- Proxies
- DNS Caching
- Cookies Issues
- Outdated versions of the browser
- Firewall or Antivirus interferences with the browser

As both you and the original poster are getting this error I suspect its related to a proxy or something on your office connection

> [@omgalvan.86](#):
>
> Is that related to the missing favicon?

No the favicon thing is not important, its likely related to whatever is causing the connection refused. You need to work out why the browser cannot connect. Is port 3000 open?

---

<div class="post-metadata">

**Author:** ![omgalvan.86](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/o/e8c25b/32.png) [@omgalvan.86](https://primero.supporthub.dev/forum/u/omgalvan.86)\
**Post date:** [May 15, 2020, 3:35am UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300/27 "2020-05-15T03:35:43Z")

</div>

> As a sanity check - you are running all of this on the same machine right

It’s interesting that you mention that, because we were trying to access the Primero instance from a separate box. In particular, I still got the blank page when accessing a Primero instance deployed on a VM from its host.

Now I’ve tried to deploy an instance on a VM running Ubuntu Desktop (as opposed to Server) and access it from that same machine; this worked fine. This, coupled with the fact that no SSL certs are involved at all, makes me think that v2 is set so that only accessing it from localhost will work; any connection attempts from other boxes will fail. Is this correct? If so, where is this documented?

(Notice that when I tried to access 0.0.0.0 before I was using curl from Ubuntu Server, and thought I was getting the same “blank page” because the HTML I was getting was the same as the one I was seeing on a browser).

---

<div class="post-metadata">

**Author:** ![irlawrence](https://primero.supporthub.dev/forum/user_avatar/primero.supporthub.dev/irlawrence/32/8_2.png) [@irlawrence](https://primero.supporthub.dev/forum/u/irlawrence)\
**Post date:** [May 15, 2020, 12:45pm UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300/28 "2020-05-15T12:45:33Z")

</div>

To do something like that you will need to bridge the network between the host and guest machines

 ![bridged](https://primero.supporthub.dev/forum/uploads/primero/original/1X/2a4f77106727dbf77e71d2606d5b117668d5dd0d.png)

and then add a line into the hosts /etc/hosts mapping to the internal IP of the guest like so

`192.168.11.15 primerov2.test`

in the hosts browser you can then do [http://primerov2.test:3000](http://primerov2.test:3000) and access the site.Doing something like this was outside the scope of the original how to and I have not tested this on v2 (only on v1) but there is nothing in v2 stopping it from working

---

<div class="post-metadata">

**Author:** ![omgalvan.86](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/o/e8c25b/32.png) [@omgalvan.86](https://primero.supporthub.dev/forum/u/omgalvan.86)\
**Post date:** [May 15, 2020, 9:27pm UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300/29 "2020-05-15T21:27:25Z")

</div>

Yes, of course I had bridged the network. The /etc/hosts mapping isn’t even needed, as I can just type the guest’s IP address on a browser, but I did it anyway and it’s still not working.

Can you please try this on v2? If v2 isn’t designed to prevent this, then there may be an issue with it.

---

<div class="post-metadata">

**Author:** ![irlawrence](https://primero.supporthub.dev/forum/user_avatar/primero.supporthub.dev/irlawrence/32/8_2.png) [@irlawrence](https://primero.supporthub.dev/forum/u/irlawrence)\
**Post date:** [May 19, 2020, 12:19pm UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300/30 "2020-05-19T12:19:39Z")

</div>

OK, I will do a walkthrough with that set up too. As another check you changed the value of `PRIMERO_HOST` in your docker `local.env`, right?

```
USE_LETS_ENCRYPT=false
PRIMERO_HOST=localhost
PRIMERO_SECRET_KEY_BASE=PRIMERO_SECRET_KEY_BASE
POSTGRES_PASSWORD=something
POSTGRES_DB=somethingelse
DEVISE_SECRET_KEY=DEVISE_SECRET_KEY
DEVISE_JWT_SECRET_KEY=DEVISE_JWT_SECRET_KEY

```

---

<div class="post-metadata">

**Author:** ![omgalvan.86](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/o/e8c25b/32.png) [@omgalvan.86](https://primero.supporthub.dev/forum/u/omgalvan.86)\
**Post date:** [May 19, 2020, 9:20pm UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300/32 "2020-05-19T21:20:07Z")

</div>

I did not. What should I put there, what commands should I run afterwards? And more importantly, where is this documented?

---

<div class="post-metadata">

**Author:** ![omgalvan.86](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/o/e8c25b/32.png) [@omgalvan.86](https://primero.supporthub.dev/forum/u/omgalvan.86)\
**Post date:** [May 25, 2020, 4:17pm UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300/33 "2020-05-25T16:17:27Z")

</div>

Pinging this thread again, since @irlawrence mentioned a separate config file which wasn’t described in the original guide and may be the reason why accessing the server from a different host is failing.

---

<div class="post-metadata">

**Author:** ![irlawrence](https://primero.supporthub.dev/forum/user_avatar/primero.supporthub.dev/irlawrence/32/8_2.png) [@irlawrence](https://primero.supporthub.dev/forum/u/irlawrence)\
**Post date:** [May 25, 2020, 5:35pm UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300/34 "2020-05-25T17:35:56Z")

</div>

Compose supports declaring default environment variables in an environment file named `.env` placed in the folder where the `docker-compose` command is executed which is `docker` in our case.  
This command

> [@irlawrence](#):
>
> cp local.env.sample.development local.env

copies some example variables which are set up for localhost development. There is also local.env.sample.production which contains other variables used in production like the smtp server, the location of the configuration file if you do not want to set up using seeds and so on  
You could try to change this line to `primerov2.test` (or whatever name you are using on the bridge)

> [@irlawrence](#):
>
> PRIMERO\_HOST=localhost

See more about [how to configure your containers here](https://github.com/primeroIMS/primero/blob/development_v2/docker/README.md)

Hope this helps

---

<div class="post-metadata">

**Author:** ![omgalvan.86](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/o/e8c25b/32.png) [@omgalvan.86](https://primero.supporthub.dev/forum/u/omgalvan.86)\
**Post date:** [May 28, 2020, 10:53pm UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300/35 "2020-05-28T22:53:28Z")

</div>

I already tried this, and it’s still not working.

I think this guide should be updated with the missing steps, since right now it’s not very useful except maybe for Primero devs.

---

<div class="post-metadata">

**Author:** ![josh](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://primero.supporthub.dev/forum/u/josh)\
**Post date:** [March 31, 2021, 8:53am UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300/36 "2021-03-31T08:53:20Z")

</div>

I have exactly the same problem. I’ve installed Primero on a Linode VM, and when trying to access it using my public IP ([http://xxx.xxx.xxx.xxx:3000](http://xxx.xxx.xxx.xxx:3000)) I get the blank white page, with “net::ERR\_BLOCKED\_BY\_CLIENT” errors in the console.

Did you ever resolve this, omgalvan.86?

V2 really doesn’t seem to be in a state where we can easily deploy it at this point.

---

<div class="post-metadata">

**Author:** ![irlawrence](https://primero.supporthub.dev/forum/user_avatar/primero.supporthub.dev/irlawrence/32/8_2.png) [@irlawrence](https://primero.supporthub.dev/forum/u/irlawrence)\
**Post date:** [April 22, 2021, 10:47pm UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300/37 "2021-04-22T22:47:35Z")

</div>

Please take a look at this thread. We are [working on some docs](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416) to do a set up using ansible. Contributions welcome

---

<div class="post-metadata">

**Author:** ![irlawrence](https://primero.supporthub.dev/forum/user_avatar/primero.supporthub.dev/irlawrence/32/8_2.png) [@irlawrence](https://primero.supporthub.dev/forum/u/irlawrence)\
**Post date:** [May 22, 2021, 2:49pm UTC](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300/38 "2021-05-22T14:49:41Z")

</div>

I just completed a set up guide for a [v2 production deployment](https://primero.supporthub.dev/forum/t/self-hosting-primero-v2-installation/434). Please read both the [security](https://primero.supporthub.dev/forum/t/how-to-security-harden-a-server/428) and [set up](https://primero.supporthub.dev/forum/t/self-hosting-primero-v2-background-and-set-up/429) posts forst

[Previous page](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300.md?page=1)
