Skip to content

How To: Run Orcpub on Windows 10 with Docker

DivertedCircle edited this page Mar 22, 2020 · 1 revision

Requirements

Requires Microsoft Windows 10 Professional or Enterprise 64-bit. (Hyper-V Support IS required)

Install git with defaults. https://git-scm.com/downloads

Install Docker with defaults. (reboot is required) https://www.docker.com/get-started

Install Notepad++ https://notepad-plus-plus.org/download/ (optional but a good editor)

Install Cygwin https://www.cygwin.com/setup-x86_64.exe

Install to c:\cygwin\ and save the repository to c:\cygwin\

Next add c:\cygwin\bin\ to your System Variables Path.

# Select Path under System Variables
C:\Users\john>rundll32 sysdm.cpl,EditEnvironmentVariables 

Pre install checks

Check to see if you have OpenSSL installed (Part of Cygwin)

Open a cmd prompt (start -> cmd) type:

openssl

The output should look like

C:\Users\john>openssl
OpenSSL>

(CNTRL+C to exit)

Install OrcPub

Open a cmd prompt (start -> cmd)

mkdir c:\orcpub
cd c:\orcpub
git clone https://github.com/Orcpub/orcpub.git

This will copy the orcpub from Github down to your orcpub dir Now edit docker-compose.yaml with notepad++ and change settings:

Change:

EMAIL_SERVER_URL: ''  
EMAIL_ACCESS_KEY: ''  
EMAIL_SECRET_KEY: ''  
EMAIL_SERVER_PORT: 587  
# Email address to send errors to  
EMAIL_ERRORS_TO: ''

To your email server. In this example we will use gmail to send our emails. (Do not use this enter your own)

EMAIL_SERVER_URL: 'smtp.gmail.com'  
EMAIL_ACCESS_KEY: '<your full gmail@gmail.com>'  
EMAIL_SECRET_KEY: '<yourpassword>'  
EMAIL_SERVER_PORT: 587  
# Email address to send errors to  
EMAIL_ERRORS_TO: '<email address to end errors to>  - or just leave blank'

Generate Certificates:

Open a cmd prompt (if you closed it) (start -> cmd)

cd c:\orcpub\orcpub\deploy\
snakeoil.bat

You should see the output

C:\orcpub\orcpub\deploy>snakeoil.bat

C:\orcpub\orcpub\deploy>openssl req -subj "/C=PL/ST=Warsaw/L=Warsaw/O=Orcpub Web/OU=Orcpub/CN=*/" -x509 -nodes -days 365 -newkey rsa:2048 -keyout "snakeoil.key" -out "snakeoil.crt"
Generating a 2048 bit RSA private key
....+++++
...............................................................................+++++
unable to write 'random state'
writing new private key to 'snakeoil.key'
-----

(or replace the ones under deploy with your real ones, file names can be found in the deploy/nginx.conf)

Enable the shared drive. https://docs.docker.com/docker-for-windows/ See the Shared Drive section. Check the checkbox on C: and enter your credentials.

Start the docker:

Open a Admin PowerShell prompt (start -> PowerShell, right click run as admin)

cd c:\orcpub\orcpub\
docker-compose up --build

At this point you will see a lot of text scrolling by, if successful it will end with:

[main] INFO org.eclipse.jetty.server.ServerConnector - Started ServerConnector@1082883b{HTTP/1.1,[http/1.1, h2c, h2c-17, h2c-16, h2c-15, h2c-14]}{0.0.0.0}
[main] INFO org.eclipse.jetty.server.Server - Started @12505ms

Hit your ip address in your browser https://localhost or http://localhost and you should get the orcpub page.

Errors and what to do about them

ERROR: for orcpub_web_1  Cannot start service web: driver failed programming external connectivity on endpoint
orcpub_web_1 (10a745f2ec8f3a6bfc370f19c04dd56b1ce67ed66ac6a1b3388caa37d7c97db1): 
Error starting userland proxy: Bind for 0.0.0.0:80: unexpected error Permission denied

or

ERROR: for orcpub_web_1  Cannot start service web: driver failed programming external connectivity on endpoint
orcpub_web_1 (10a745f2ec8f3a6bfc370f19c04dd56b1ce67ed66ac6a1b3388caa37d7c97db1): 
Error starting userland proxy: Bind for 0.0.0.0:443: unexpected error Permission denied

Something is using port 80 or 443. Disable World Wide Web Publishing Service or find the process with netstat -anb|more