DEV Community

Cover image for OWASP JUICE SHOP SET UP WITH DOCKER
haXarubiX
haXarubiX

Posted on

OWASP JUICE SHOP SET UP WITH DOCKER

Step-by-Step Docker Installation and Juice Shop Setup

Part 1: Installing Docker

  1. Docker Installation on Windows and macOS

Docker Desktop makes it incredibly easy to set up Docker on both Windows and macOS. Here’s a quick guide to get you started.

Steps for both Windows and macOS:

1. Download Docker Desktop:

Visit the Docker Desktop website and click “Download for Windows” or “Download for Mac,” depending on your operating system.

2. Install Docker Desktop:

On Windows, simply run the installer .exe file and follow the on-screen instructions.

On macOS, open the downloaded .dmg file and drag Docker to your Applications folder.

3. Launch Docker Desktop:

After installation, launch Docker Desktop.

Docker Desktop will guide you through the initial setup, and within a few clicks, Docker will be up and running.

  1. Verify Docker Installation:

Open PowerShell (Windows) or Terminal (macOS) and type:



docker --version



Enter fullscreen mode Exit fullscreen mode

You should see the installed version of Docker printed in the terminal.

That’s it! Docker is now installed and ready for use. You don’t need to worry about additional steps since Docker Desktop handles everything, including setting up Docker Compose.

2. Docker Installation on Debian-based Linux (Ubuntu/Kali)

For Linux users (particularly Debian-based systems like Ubuntu or Kali), installing Docker is also straightforward.

  1. Update Your System: Open your terminal and run the following to ensure your system is up to date:


sudo apt update && sudo apt upgrade


Enter fullscreen mode Exit fullscreen mode
  1. Install Docker: Install Docker using the following command:


sudo apt install docker.io


Enter fullscreen mode Exit fullscreen mode
  1. Install Docker Compose: Since Docker Compose is often used alongside Docker, install it as well:


sudo apt install docker-compose


Enter fullscreen mode Exit fullscreen mode
  1. Start and Enable Docker: Enable Docker to start at boot and launch it right away:


sudo systemctl enable docker


Enter fullscreen mode Exit fullscreen mode


sudo systemctl start docker


Enter fullscreen mode Exit fullscreen mode
  1. Verify Installation: Run the following command to check if Docker is installed correctly:


docker --version


Enter fullscreen mode Exit fullscreen mode

That's it for Linux! Docker and Docker Compose are now installed and ready for use.


Part 2: Pulling and Running Juice Shop with Docker

Now that Docker is installed, let's set up the Juice Shop container.

Steps to Set Up Juice Shop in Docker:

  1. Open Your Terminal (or PowerShell on Windows):

  2. Pull the Juice Shop Docker Image: Run the following command to pull the latest Juice Shop image from Docker Hub:



docker pull bkimminich/juice-shop


Enter fullscreen mode Exit fullscreen mode
  1. Run the Juice Shop Container: Use this command to run the container in the background and make it accessible from your browser:


docker run -d -p 3000:3000 --name juice-shop bkimminich/juice-shop


Enter fullscreen mode Exit fullscreen mode

-d: Runs the container in the background (detached mode).

-p 3000:3000: Exposes port 3000 on your machine and maps it to port 3000 in the container.

--name juice-shop: Names the container "juice-shop."

  1. Access Juice Shop in Your Browser: Open your web browser and navigate to:

  1. Verify Juice Shop is Running: To ensure the container is running, you can check by using:


docker ps


Enter fullscreen mode Exit fullscreen mode

This will list the currently running containers, and you should see "juice-shop" in the list.

  1. Stopping and Restarting Juice Shop:

To stop the Juice Shop container, run:



docker stop juice-shop


Enter fullscreen mode Exit fullscreen mode

To restart it:



docker start juice-shop


Enter fullscreen mode Exit fullscreen mode

Conclusion

With Docker now easily installed and Juice Shop running, you’re ready to explore the various vulnerabilities that Juice Shop presents. The setup is designed to be accessible for all platforms, and you can now start practicing hacking. (this is a great place to start of you are interested in bug bounty "hacking")

In our next post, we’ll start exploring specific challenges in Juice Shop and guide you through solving them.

Hax the rubix leave the cube.

Top comments (0)