• Docs >
  • 15. TorchServe on Windows Subsystem for Linux (WSL)

15. TorchServe on Windows Subsystem for Linux (WSL)

  • Ubuntu 18.0.4

15.1. Contents of this Document

15.2. Setup Ubuntu 18.0.4 on WSL:

15.3. Install from binaries

  1. Setup Ubuntu Environment

wget -O - https://raw.githubusercontent.com/pytorch/serve/master/ts_scripts/setup_wsl_ubuntu | bash
echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
  1. Install JDK 11

sudo apt-get install openjdk-11-jdk
  1. Install Dependencies

pip install torch torchtext torchvision sentencepiece psutil future
pip install torchserve torch-model-archiver

15.4. Install from source

  1. Clone and install TorchServe

git clone https://github.com/pytorch/serve.git
cd serve

export PATH=$HOME/.local/bin:$PATH
python ./ts_scripts/install_from_src.py
echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc


Access comprehensive developer documentation for PyTorch

View Docs


Get in-depth tutorials for beginners and advanced developers

View Tutorials


Find development resources and get your questions answered

View Resources