Multiple Instances of ZAP on One Ubuntu Server using Command Line

298 views
Skip to first unread message

Odane Barnes

unread,
Feb 10, 2021, 3:53:47 PM2/10/21
to OWASP ZAP User Group
Hi all.

I am new to ZAP and want to use it to test multiple websites for clients concurrently. I know how to run tasks in the background using nohup and detaching it from the shell so it can run when I close the terminal window. 

If I start another Zap instance on the same machine, will this cause a conflict, data corruption or any thread safety issues? 

How do I go about this via command line on one machine?

Simon Bennetts

unread,
Feb 11, 2021, 4:32:34 AM2/11/21
to OWASP ZAP User Group
Hiya,

Yes, you can run as many ZAP instances on one machine as that machine can cope with.
However you must start them in different directories (uing the '-dir' command line option) and with different ports (using the '-port' parameter).
To put ZAP in the background use the '-daemon' option, you will still be able to control it via the API.

Cheers,

Simon

SP

unread,
Feb 23, 2021, 1:38:00 PM2/23/21
to OWASP ZAP User Group
Hey,
I'm having a problem because like you say, I can run many as my machine can hope, but when I do the fifth or above scan, It brokens and don't work, only works the top four or five.
I'm running it with that command: java -jar "path" -daemon -silent -port "I'm increasing it"  -dir "different path for each scan" -config api.key="different api for each scan" &.
I'm doing something wrong?
Thanks for your time.

Simon Bennetts

unread,
Feb 24, 2021, 4:39:57 AM2/24/21
to OWASP ZAP User Group
I dont recommend using `java -jar ...` to run ZAP. We provide the `zap.sh` and `zap.bat` scripts so you should always use those when starting ZAP from the command line.
Its difficult to tell if you are doing anything else wrong as you havnt given us any details of how it breaks.
What does / doesnt happen? Are there any errors shown in any of the zap.log files?

FYI just one ZAP instance can put a significant strain on a machine.
If you are trying to run 5 or more at the same time then it could well be too much for your machine.

Cheers,

Simon
Reply all
Reply to author
Forward
0 new messages