• [+] expand all

Quick Start

This guide shows how to install and run Vespa on a single machine using Docker - it deploys an application, feeds some data and issues queries. See Getting Started for troubleshooting, next steps and other guides.

This guide is tested with docker desktop, 4.11.0 (83626) on MacOS and vespaengine/vespa:8.28.12 Docker image.

Running Vespa in Docker

  1. Validate the environment:

    $ docker info | grep "Total Memory"
    

    Make sure you see at minimum 4 GB.

  2. Install the Vespa CLI:

    Using Homebrew:

    $ brew install vespa-cli
    

    You can also download Vespa CLI for Windows, Linux and macOS.

  3. Set local target:

    $ vespa config set target local
    
  4. Start a Vespa Docker container:

    $ docker run --detach --name vespa --hostname vespa-container \
      --publish 8080:8080 --publish 19071:19071 \
      vespaengine/vespa
    

    The port 8080 is published to make the search and feed interfaces accessible from outside the docker container, 19071 is the config server endpoint. Only one docker container named vespa can run at a time so change the name if needed. See Docker containers for more insights.

  5. Verify it is ready to use:

    $ vespa status deploy --wait 300
    
  6. Initialize myapp/ to a copy of a sample application package:

    $ vespa clone album-recommendation myapp && cd myapp
    
  7. Deploy it:

    $ vespa deploy --wait 300
    
  8. Feed documents:

    $ vespa document ext/A-Head-Full-of-Dreams.json && \
      vespa document ext/Love-Is-Here-To-Stay.json && \
      vespa document ext/Hardwired...To-Self-Destruct.json
    

    This uses the /document/v1/ API - use vespa-feed-client to feed large amounts of data, fast.

  9. Issue queries:

    $ vespa query "select * from music where album contains 'head'"
    
    $ vespa query "select * from music where true" \
      "ranking=rank_albums" \
      "input.query(user_profile)={{cat:pop}:0.8,{cat:rock}:0.2,{cat:jazz}:0.1}"
    
    This uses the Query API.

Next steps

Check out getting started for more tutorials and use cases which Vespa is great for.

$ vespa test tests/system-test