On MacOS you can install and run it as a background service using brew:
Download Brew if you don't have it:
Brew is a package manager for MacOS
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
Install DynamoDB Local using Brew:
brew install dynamodb-local
Run DynamoDB as a local service:
This will ensure DynamoDB local starts up when you reboot your machine.
brew services start dynamodb-local
Run DynamoDB Local as a one-time startup:
This method will run DynamoDB local one time. You will need to re-run this upon restart.
/usr/local/bin/dynamodb-local
Then you can hit dynamoDB in a shell from your browser:
http://localhost:8000/shell/
You can interact with your DynamoDB using Javascript.

View this article for a more detailed explanation of Running a AWS DynamoDB instance locally