# Server Set Up for v2

**URL:** <https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416>\
**Category:** CPIMS\
**Tags:** v2-0\
**Created:** [April 19, 2021, 8:43pm UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416 "2021-04-19T20:43:51Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpanchalingam](https://primero.supporthub.dev/forum/user_avatar/primero.supporthub.dev/jpanchalingam/32/73_2.png) [@jpanchalingam](https://primero.supporthub.dev/forum/u/jpanchalingam)\
**Post date:** [April 19, 2021, 8:43pm UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/1 "2021-04-19T20:43:51Z")

</div>

Does your team have some step by step document for installing the server (outside of the [Primero GitHub](https://github.com/primeroIMS/primero)), start from the beginning and including the web service setup?

---

<div class="post-metadata">

**Author:** ![childprotectioninnov](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@childprotectioninnov](https://primero.supporthub.dev/forum/u/childprotectioninnov)\
**Post date:** [April 19, 2021, 8:46pm UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/2 "2021-04-19T20:46:14Z")

</div>

Yes we have a v2 guide for Ubuntu 18.04 which can be found here: [Installing Primero v2 for development on Ubuntu 18.04](https://primero.supporthub.dev/forum/t/installing-primero-v2-for-development-on-ubuntu-18-04/300)

We also are developing an installation guidance which can be found here: [Primero v2 Installation Notes - Google Documenten](https://docs.google.com/document/d/1M7qpZsMgF7b9PNbk564VK1x2Sm67pqDDXVCun7Ne_vM/edit#heading=h.sbymxgpo2r3u)

---

<div class="post-metadata">

**Author:** ![pnoensuwan](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/p/5fc32e/32.png) [@pnoensuwan](https://primero.supporthub.dev/forum/u/pnoensuwan)\
**Post date:** [April 28, 2021, 4:22am UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/3 "2021-04-28T04:22:00Z")

</div>

Dear @childprotectioninnov ,

Thank you very much for sharing, I’m trying to set up a test environment for production follow you instruction and may I know if we need to ‘clone’ the project from ‘[GitHub - primeroIMS/primero: Primero is an application designed to help child protection workers and social workers in humanitarian and development contexts manage data on vulnerable children and survivors of violence. Please carefully read our LICENSE. If you would like access to the CPIMS+ and GBVIMS+ configurations, please contact: childprotectioninnovation@gmail.com](https://github.com/primeroIMS/primero)’ before go for configuration step?

Thank you.

Best regards,  
Prasitsak N. (Art)

---

<div class="post-metadata">

**Author:** ![pnoensuwan](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/p/5fc32e/32.png) [@pnoensuwan](https://primero.supporthub.dev/forum/u/pnoensuwan)\
**Post date:** [April 28, 2021, 8:25am UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/4 "2021-04-28T08:25:13Z")

</div>

@childprotectioninnov and another question, in the guidance mentioned about private RSA key, do you have any specific tool creating the key?

And my draft version is [HERE](https://drive.google.com/file/d/1OZjqrMORkAZSttmltJ12GnvOPzapdIew/view?usp=sharing), but will need to grant you a permission.

Thank you.  
Prasitsak N. (Art)

---

<div class="post-metadata">

**Author:** ![jpanchalingam](https://primero.supporthub.dev/forum/user_avatar/primero.supporthub.dev/jpanchalingam/32/73_2.png) [@jpanchalingam](https://primero.supporthub.dev/forum/u/jpanchalingam)\
**Post date:** [May 3, 2021, 7:33pm UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/5 "2021-05-03T19:33:09Z")

</div>

What I did was:

1. Clone primero project from ‘[https://github.com/primeroIMS/primero’](https://github.com/primeroIMS/primero%E2%80%99) to root (/) directory.
2. Setup password-less to allow Deployment server access to the Production server.
3. Create inventory.yml file from template and modified as follow;

**Inventory.yml**  
all:  
hosts:  
[primero.example.com](http://primero.example.com):  
ansible\_user: ‘primero’  
primero\_host: ‘[IP Address of the production server]’  
primero\_tag: ‘latest’  
locale\_all: ‘en,fr,ar’  
always\_pull: true,  
# These 3 variables are used to drive the build task.  
# Can be omitted if pulling images from Dockerhub  
primero\_repo\_branch: ‘development\_v2’  
build\_docker\_tag: ‘latest’  
build\_docker\_container\_registry: ‘’  
# If you want to seed from a private configuration repo  
primero\_configuration\_repo: ‘git@bitbucket.org:quoin/primero-x-configuration.git’  
primero\_configuration\_repo\_branch: ‘master’  
primero\_configuration\_path: ‘directory/of/config/loader/script’  
use\_lets\_encrypt: ‘true’  
# The other certbot/lets\_encrypt variables are optional. Include only if using Let’s Encrypt  
certbot\_domain:

1. Generate secret using command ‘LC\_ALL=C \< /dev/urandom tr -dc ‘\_A-Z-a-z-0-9’ | head -c"${1:-32}"’
2. Edited ‘secrets.yml’ file as follows:

**Secrets.yml**  
primero\_secret\_key\_base: ‘OXdI6n\_u46uXp1t15pb5fOyIV0rI7-Di’  
primero\_message\_secret: ‘OXdI6n\_u46uXp1t15pb5fOyIV0rI7-Di’  
postgres\_password: ‘OXdI6n\_u46uXp1t15pb5fOyIV0rI7-Di’  
devise\_secret\_key: ‘OXdI6n\_u46uXp1t15pb5fOyIV0rI7-Di’  
devise\_jwt\_secret\_key: ‘OXdI6n\_u46uXp1t15pb5fOyIV0rI7-Di’  
ssh\_private\_key: |  
-----BEGIN RSA PRIVATE KEY-----  
-----END RSA PRIVATE KEY-----

1. Ran ‘ansible-playbook bootstrap.yml’ command at /primero/ansible, and got error message below,

* * *

Error message after ran ‘ansible-playbook bootstrap.yml’  
ERROR! the role ‘quoin.infrastructure.install\_python3’ was not found in /home/primero/primero/ansible/roles:/home/primero/primero/ansible/roles:/home/primero/primero/ansible

The error appears to be in ‘/home/primero/primero/ansible/bootstrap.yml’: line 9, column 5, but may  
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

roles:  
‘quoin.infrastructure.install\_python3’  
^ here

* * *

1. I checked in the ‘/primero/ansible/roles’ and found that there is no a role name ‘quoin.infrastructure.install\_python3’ as stated in the error above, there are only three roles listed below,  
application-primero manage-users primero-certbot prune

Could you please advise?

---

<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 3, 2021, 10:28pm UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/6 "2021-05-03T22:28:42Z")

</div>

Are you in the `ansible/` directory? If you are you need to also run `bin/activate`

---

<div class="post-metadata">

**Author:** ![pnoensuwan](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/p/5fc32e/32.png) [@pnoensuwan](https://primero.supporthub.dev/forum/u/pnoensuwan)\
**Post date:** [May 4, 2021, 1:53am UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/7 "2021-05-04T01:53:51Z")

</div>

Yes, I ran this under ‘ansible/’ directory and also ‘bin/activate’ command is also already triggered.

The environment of the deployment server we currently have are:

1. Python 3.8.5
2. pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
3. ansible 2.10.8
4. Docker version 20.10.2, build 20.10.2-0ubuntu1~20.04.2

And message below is returned after ‘bin/activate’ is triggered:

- /usr/bin/python3 -m venv --system-site-packages --upgrade --prompt primero /home/primero/primero/venv
- /home/primero/primero/venv/bin/pip install -r /home/primero/primero/ansible/requirements.txt  
Requirement already satisfied: ansible==2.10.0 in /home/primero/primero/venv/lib/python3.8/site-packages (from -r /home/primero/primero/ansible/requirements.txt (line 1)) (2.10.0)  
Requirement already satisfied: boto3==1.15.7 in /home/primero/primero/venv/lib/python3.8/site-packages (from -r /home/primero/primero/ansible/requirements.txt (line 2)) (1.15.7)  
Requirement already satisfied: boto==2.49.0 in /home/primero/primero/venv/lib/python3.8/site-packages (from -r /home/primero/primero/ansible/requirements.txt (line 3)) (2.49.0)  
Requirement already satisfied: ansible-lint==4.3.5 in /home/primero/primero/venv/lib/python3.8/site-packages (from -r /home/primero/primero/ansible/requirements.txt (line 4)) (4.3.5)  
Requirement already satisfied: ansible-base\<2.11,\>=2.10.1 in /usr/local/lib/python3.8/dist-packages (from ansible==2.10.0-\>-r /home/primero/primero/ansible/requirements.txt (line 1)) (2.10.8)  
Requirement already satisfied: botocore\<1.19.0,\>=1.18.7 in /home/primero/primero/venv/lib/python3.8/site-packages (from boto3==1.15.7-\>-r /home/primero/primero/ansible/requirements.txt (line 2)) (1.18.18)  
Requirement already satisfied: jmespath\<1.0.0,\>=0.7.1 in /home/primero/primero/venv/lib/python3.8/site-packages (from boto3==1.15.7-\>-r /home/primero/primero/ansible/requirements.txt (line 2)) (0.10.0)  
Requirement already satisfied: s3transfer\<0.4.0,\>=0.3.0 in /home/primero/primero/venv/lib/python3.8/site-packages (from boto3==1.15.7-\>-r /home/primero/primero/ansible/requirements.txt (line 2)) (0.3.7)  
Requirement already satisfied: rich in /home/primero/primero/venv/lib/python3.8/site-packages (from ansible-lint==4.3.5-\>-r /home/primero/primero/ansible/requirements.txt (line 4)) (10.1.0)  
Requirement already satisfied: ruamel.yaml\<1,\>=0.15.37; python\_version \>= “3.7” in /home/primero/primero/venv/lib/python3.8/site-packages (from ansible-lint==4.3.5-\>-r /home/primero/primero/ansible/requirements.txt (line 4)) (0.17.4)  
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (from ansible-lint==4.3.5-\>-r /home/primero/primero/ansible/requirements.txt (line 4)) (5.3.1)  
Requirement already satisfied: cryptography in /usr/lib/python3/dist-packages (from ansible-base\<2.11,\>=2.10.1-\>ansible==2.10.0-\>-r /home/primero/primero/ansible/requirements.txt (line 1)) (2.8)  
Requirement already satisfied: jinja2 in /usr/lib/python3/dist-packages (from ansible-base\<2.11,\>=2.10.1-\>ansible==2.10.0-\>-r /home/primero/primero/ansible/requirements.txt (line 1)) (2.10.1)  
Requirement already satisfied: packaging in /usr/local/lib/python3.8/dist-packages (from ansible-base\<2.11,\>=2.10.1-\>ansible==2.10.0-\>-r /home/primero/primero/ansible/requirements.txt (line 1)) (20.9)  
Requirement already satisfied: python-dateutil\<3.0.0,\>=2.1 in /home/primero/primero/venv/lib/python3.8/site-packages (from botocore\<1.19.0,\>=1.18.7-\>boto3==1.15.7-\>-r /home/primero/primero/ansible/requirements.txt (line 2)) (2.8.1)  
Requirement already satisfied: urllib3\<1.26,\>=1.20; python\_version != “3.4” in /usr/lib/python3/dist-packages (from botocore\<1.19.0,\>=1.18.7-\>boto3==1.15.7-\>-r /home/primero/primero/ansible/requirements.txt (line 2)) (1.25.8)  
Requirement already satisfied: typing-extensions\<4.0.0,\>=3.7.4 in /home/primero/primero/venv/lib/python3.8/site-packages (from rich-\>ansible-lint==4.3.5-\>-r /home/primero/primero/ansible/requirements.txt (line 4)) (3.10.0.0)  
Requirement already satisfied: pygments\<3.0.0,\>=2.6.0 in /home/primero/primero/venv/lib/python3.8/site-packages (from rich-\>ansible-lint==4.3.5-\>-r /home/primero/primero/ansible/requirements.txt (line 4)) (2.8.1)  
Requirement already satisfied: commonmark\<0.10.0,\>=0.9.0 in /home/primero/primero/venv/lib/python3.8/site-packages (from rich-\>ansible-lint==4.3.5-\>-r /home/primero/primero/ansible/requirements.txt (line 4)) (0.9.1)  
Requirement already satisfied: colorama\<0.5.0,\>=0.4.0 in /usr/lib/python3/dist-packages (from rich-\>ansible-lint==4.3.5-\>-r /home/primero/primero/ansible/requirements.txt (line 4)) (0.4.3)  
Requirement already satisfied: ruamel.yaml.clib\>=0.1.2; platform\_python\_implementation == “CPython” and python\_version \< “3.10” in /home/primero/primero/venv/lib/python3.8/site-packages (from ruamel.yaml\<1,\>=0.15.37; python\_version \>= “3.7”-\>ansible-lint==4.3.5-\>-r /home/primero/primero/ansible/requirements.txt (line 4)) (0.2.2)  
Requirement already satisfied: pyparsing\>=2.0.2 in /usr/local/lib/python3.8/dist-packages (from packaging-\>ansible-base\<2.11,\>=2.10.1-\>ansible==2.10.0-\>-r /home/primero/primero/ansible/requirements.txt (line 1)) (2.4.7)  
Requirement already satisfied: six\>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil\<3.0.0,\>=2.1-\>botocore\<1.19.0,\>=1.18.7-\>boto3==1.15.7-\>-r /home/primero/primero/ansible/requirements.txt (line 2)) (1.14.0)
- /home/primero/primero/venv/bin/ansible-galaxy install -r /home/primero/primero/ansible/requirements.yml  
Traceback (most recent call last):  
File “bin/activate”, line 209, in   
code = \_main(argv)  
File “bin/activate”, line 201, in \_main  
code = command.run()  
File “bin/activate”, line 184, in run  
create\_venv(self.\_paths)  
File “bin/activate”, line 76, in create\_venv  
check\_call([paths.ansible\_galaxy\_file, ‘install’, ‘-r’, paths.ansible\_galaxy\_requirements\_file], cwd = paths.ansible\_dir)  
File “bin/activate”, line 26, in check\_call  
subprocess.check\_call(args, \*popenargs, \*\*kwargs)  
File “/usr/lib/python3.8/subprocess.py”, line 359, in check\_call  
retcode = call(\*popenargs, \*\*kwargs)  
File “/usr/lib/python3.8/subprocess.py”, line 340, in call  
with Popen(\*popenargs, \*\*kwargs) as p:  
File “/usr/lib/python3.8/subprocess.py”, line 854, in **init**  
self.\_execute\_child(args, executable, preexec\_fn, close\_fds,  
File “/usr/lib/python3.8/subprocess.py”, line 1702, in \_execute\_child  
raise child\_exception\_type(errno\_num, err\_msg, err\_filename)  
FileNotFoundError: [Errno 2] No such file or directory: ‘/home/primero/primero/venv/bin/ansible-galaxy’

---

<div class="post-metadata">

**Author:** ![rodrigo](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/r/4af34b/32.png) [@rodrigo](https://primero.supporthub.dev/forum/u/rodrigo)\
**Post date:** [May 4, 2021, 1:20pm UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/8 "2021-05-04T13:20:26Z")

</div>

Try to install ansible system wide and do not use bin/activate.

sudo pip install ansible

---

<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 4, 2021, 3:10pm UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/9 "2021-05-04T15:10:57Z")

</div>

> [@jpanchalingam](#):
>
> primero\_secret\_key\_base: ‘OXdI6n\_u46uXp1t15pb5fOyIV0rI7-Di’  
> primero\_message\_secret: ‘OXdI6n\_u46uXp1t15pb5fOyIV0rI7-Di’  
> postgres\_password: ‘OXdI6n\_u46uXp1t15pb5fOyIV0rI7-Di’  
> devise\_secret\_key: ‘OXdI6n\_u46uXp1t15pb5fOyIV0rI7-Di’  
> devise\_jwt\_secret\_key: ‘OXdI6n\_u46uXp1t15pb5fOyIV0rI7-Di’

You should never use these secrets (apart from in testing). Please generate them again and use those on your real server. You also need different secrets for each service so you cannot use the same one for all

---

<div class="post-metadata">

**Author:** ![pnoensuwan](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/p/5fc32e/32.png) [@pnoensuwan](https://primero.supporthub.dev/forum/u/pnoensuwan)\
**Post date:** [May 5, 2021, 2:12am UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/10 "2021-05-05T02:12:32Z")

</div>

Hi @rodrigo,

Thank you for your reply,

Are you specific running this command on the deployment server or node server?

BTW, ‘sudo pip install ansible’ won’t work, but ‘sudo pip **strong text** 3 install ansible’.

I tried to running ‘pip --version’, it’s returned ‘command ‘pip’ not found but there are 18 similar ones’

**And when I run ‘pip3 --version’;**  
primero@thlaubt20042vm1:~/primero/ansible$ pip3 --version  
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

**When I run ‘sudo apt-get install python3-pip’**  
primero@thlaubt20042vm1:~/primero/ansible$ sudo apt-get install python3-pip  
Reading package lists… Done  
Building dependency tree  
Reading state information… Done  
python3-pip is already the newest version (20.0.2-5ubuntu1.1).  
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

**When I run ‘which pip3’**  
primero@thlaubt20042vm1:/primero/ansible/bin$ which pip3  
/usr/bin/pip3

Not sure if we will need to modify script that is related to ‘pip’.

Could you please assist?

Thank you.

Regards,  
Art

---

<div class="post-metadata">

**Author:** ![pnoensuwan](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/p/5fc32e/32.png) [@pnoensuwan](https://primero.supporthub.dev/forum/u/pnoensuwan)\
**Post date:** [May 5, 2021, 6:40am UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/11 "2021-05-05T06:40:27Z")

</div>

Hi @irlawrence ,

Thank you for your suggestion, this secret is setup on a test environment.

And may I ask for your advise regards creating a secret key, can I use other method instead of using a command ‘LC\_ALL=C \< /dev/urandom tr -dc ‘\_A-Z-a-z-0-9’ | head -c"${1:-32}"’  
(e.g. ‘pwgen -s 32 5’)?

Thank you.

Regards,  
Art

---

<div class="post-metadata">

**Author:** ![rodrigo](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/r/4af34b/32.png) [@rodrigo](https://primero.supporthub.dev/forum/u/rodrigo)\
**Post date:** [May 6, 2021, 5:48pm UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/12 "2021-05-06T17:48:40Z")

</div>

It is ok to replace pip by pip3.

---

<div class="post-metadata">

**Author:** ![rodrigo](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/r/4af34b/32.png) [@rodrigo](https://primero.supporthub.dev/forum/u/rodrigo)\
**Post date:** [May 6, 2021, 5:49pm UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/13 "2021-05-06T17:49:24Z")

</div>

Yes, I personally use pwgen.

---

<div class="post-metadata">

**Author:** ![pnoensuwan](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/p/5fc32e/32.png) [@pnoensuwan](https://primero.supporthub.dev/forum/u/pnoensuwan)\
**Post date:** [May 12, 2021, 8:50am UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/14 "2021-05-12T08:50:16Z")

</div>

@rodrigo Thank you for your reply, I did some change and found that the error message is changed, now it’s returned an error of

**'FileNotFoundError: [Errno 2] No such file or directory: '/home/_[user]_ /primero/venv/bin/ansible-galaxy''**

I have checked in the ‘/home/_[user]_/primero/venv/bin’ directory and seems that there is no **‘ansible-galaxy’** there

drwxrwxr-x 3 primero primero 4096 May 3 11:27 .  
drwxrwxr-x 6 primero primero 4096 May 3 11:24 …  
-rw-r–r-- 1 primero primero 2212 May 3 11:24 activate  
-rw-r–r-- 1 primero primero 1258 May 3 11:24 activate.csh  
-rw-r–r-- 1 primero primero 2416 May 3 11:24 activate.fish  
-rw-r–r-- 1 primero primero 8834 May 3 11:24 Activate.ps1  
-rwxrwxr-x 1 primero primero 241 May 3 11:27 ansible-lint  
-rwxrwxr-x 1 primero primero 12008 May 3 11:26 asadmin  
-rwxrwxr-x 1 primero primero 1574 May 3 11:26 bundle\_image  
-rwxrwxr-x 1 primero primero 3464 May 3 11:26 cfadmin  
-rwxrwxr-x 1 primero primero 237 May 3 11:26 cmark  
-rwxrwxr-x 1 primero primero 3073 May 3 11:26 cq  
-rwxrwxr-x 1 primero primero 5065 May 3 11:26 cwutil  
-rwxrwxr-x 1 primero primero 2153 May 3 11:26 dynamodb\_dump  
-rwxrwxr-x 1 primero primero 3523 May 3 11:26 dynamodb\_load  
-rwxrwxr-x 1 primero primero 252 May 3 11:24 easy\_install  
-rwxrwxr-x 1 primero primero 252 May 3 11:24 easy\_install-3.8  
-rwxrwxr-x 1 primero primero 9713 May 3 11:26 elbadmin  
-rwxrwxr-x 1 primero primero 1893 May 3 11:26 fetch\_file  
-rwxrwxr-x 1 primero primero 5266 May 3 11:26 glacier  
-rwxrwxr-x 1 primero primero 5798 May 3 11:26 instance\_events  
-rwxrwxr-x 1 primero primero 1717 May 3 11:26 jp.py  
-rwxrwxr-x 1 primero primero 944 May 3 11:26 kill\_instance  
-rwxrwxr-x 1 primero primero 10625 May 3 11:26 launch\_instance  
-rwxrwxr-x 1 primero primero 3118 May 3 11:26 list\_instances  
-rwxrwxr-x 1 primero primero 3464 May 3 11:26 lss3  
-rwxrwxr-x 1 primero primero 19168 May 3 11:26 mturk  
-rwxrwxr-x 1 primero primero 243 May 3 11:24 pip  
-rwxrwxr-x 1 primero primero 243 May 3 11:24 pip3  
-rwxrwxr-x 1 primero primero 243 May 3 11:24 pip3.8  
-rwxrwxr-x 1 primero primero 2637 May 3 11:26 pyami\_sendmail  
drwxrwxr-x 2 primero primero 4096 May 3 11:26 **pycache**  
-rwxrwxr-x 1 primero primero 237 May 3 11:26 pygmentize  
-rwxr-xr-x 1 primero primero 5486384 May 3 11:24 python  
-rwxr-xr-x 1 primero primero 5486384 May 12 08:04 python3  
-rwxrwxr-x 1 primero primero 9054 May 3 11:26 route53  
-rwxrwxr-x 1 primero primero 16859 May 3 11:26 s3put  
-rwxrwxr-x 1 primero primero 7015 May 3 11:26 sdbadmin  
-rwxrwxr-x 1 primero primero 3789 May 3 11:26 taskadmin

---

<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, 2021, 11:16am UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/15 "2021-05-12T11:16:22Z")

</div>

As a sanity check you are in the virtual environment, right? Basically you do this →

```
  $ cd ansible
  $ bin/activate

```

which changes the shell to something like this →

`(venv) $ `

---

<div class="post-metadata">

**Author:** ![pnoensuwan](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/p/5fc32e/32.png) [@pnoensuwan](https://primero.supporthub.dev/forum/u/pnoensuwan)\
**Post date:** [May 18, 2021, 1:09pm UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/16 "2021-05-18T13:09:44Z")

</div>

@irlawrence Thank you, the error above occurred when ran the ‘$ bin/activate’, we actually tested on the Mac OS (as specified in the requirement on the repo, and it seems to be fine when ran the ‘$ bin/activate’ command), but our Deployment server is running with Ubuntu 20.04 (as recommended).

---

<div class="post-metadata">

**Author:** ![pnoensuwan](https://primero.supporthub.dev/forum/letter_avatar_proxy/v4/letter/p/5fc32e/32.png) [@pnoensuwan](https://primero.supporthub.dev/forum/u/pnoensuwan)\
**Post date:** [May 19, 2021, 10:59am UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/17 "2021-05-19T10:59:25Z")

</div>

@irlawrence Today I have some changes on the ‘# primero/ansible/bin/activate’ file by modified the following lines,

Line 20: paths.venv\_dir = abspath\_join(paths.top\_dir, ‘venv’) to paths.venv\_dir = abspath\_join(paths.top\_dir, ‘venv35’)  
Line 22: paths.pip\_file = abspath\_join(paths.venv\_dir, ‘bin’, ‘pip’) to paths.pip\_file = abspath\_join(paths.venv\_dir, ‘bin’, ‘pip3’)

and copied ‘ansible-galaxy’ from ‘/usr/local/bin/’ to ‘/primero/venv35/bin/’

then ran ‘bin/activate’ from ‘primero/ansible’ again and got message below,

- /usr/bin/python3 -m venv --system-site-packages --upgrade --prompt primero /primero/venv35
- /primero/venv35/bin/pip3 install -r /primero/ansible/requirements.txt  
.  
.  
.  
Starting galaxy collection install process  
Process install dependency map  
Starting collection install process  
Installing ‘quoin.infrastructure:1.0.0’ to ‘/primero/ansible/ansible\_collections/quoin/infrastructure’  
Created collection for quoin.infrastructure at /primero/ansible/ansible\_collections/quoin/infrastructure  
quoin.infrastructure (1.0.0) was installed successfully

therefore, it’s not return to ’ (venv) $ '.

---

<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:52pm UTC](https://primero.supporthub.dev/forum/t/server-set-up-for-v2/416/18 "2021-05-22T14:52:46Z")

</div>

There is now a guide for [self hosting v2](https://primero.supporthub.dev/forum/t/self-hosting-primero-v2-installation/434)
