Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Install Apache Spark on Windows

Download Spark, extract it, set the environment variables and check that spark-shell starts.

Windows Hosting2 min read4 steps10 screenshots

Before you start

Spark needs Java. Open Command Prompt and check that it is installed:

java --version
Checking the Java version

If the command is not found, install a JDK first.

Step 1: Download Spark

Go to the Apache Spark download page and pick a release and a package type. Download the .tgz file.

Choosing the Spark release
Downloading the Spark package

Step 2: Extract Spark

Extract the archive to a short path such as C:\spark. A short path with no spaces avoids many errors.

Extracting the Spark files

Step 3: Set the environment variables

  1. Search for Edit the system environment variables in the Start menu and open it.
    Opening the environment variables setting
  2. Click Environment Variables.
    The Environment Variables window
  3. Under System variables, click New. Set the name to SPARK_HOME and the value to your Spark folder, for example C:\spark.
    Adding the SPARK_HOME system variable
  4. Select Path, click Edit, and add %SPARK_HOME%\bin.
    Adding Spark to the Path variable
Note: On Windows, Spark also needs winutils.exe for Hadoop. Place it in a bin folder and point HADOOP_HOME to the parent folder if Spark shows Hadoop errors.

Step 4: Check the installation

Open a new Command Prompt and run:

spark-shell --version
Running spark-shell to see the version

The Spark version banner appears.

The Spark version output

Quick recap

  • Install Java first and check it with java --version.
  • Extract Spark to a short path like C:\spark.
  • Set SPARK_HOME and add %SPARK_HOME%\bin to Path.
  • Run spark-shell --version in a new window to confirm.