Menu
User

DropVPS Team

Writer: Cooper Reagan

How to install dynamodb on CentOS 8

How to install dynamodb on CentOS 8

Publication Date

10/10/2025

Category

Articles

Reading Time

3 Min

Table of Contents

Amazon DynamoDB is a high-performance NoSQL database service designed for applications that require consistent speed and scalability. While AWS manages it in the cloud, developers can also run DynamoDB Local on their own servers for offline development and testing.

Update Your System

Before installing any software, make sure your system is up to date to avoid dependency issues:

sudo dnf update -y

Install Java

DynamoDB Local requires Java to run. Install OpenJDK 17 using:

sudo dnf install java-17-openjdk -y

Verify that Java is installed:

java -version

If you see a version output like openjdk version "17", you’re good to go.

Create a Directory for DynamoDB

Create a dedicated directory to store DynamoDB files and move into it:

mkdir ~/dynamodb
cd ~/dynamodb

Download DynamoDB Local

Use wget to get the latest version of DynamoDB Local directly from Amazon’s S3 repository:

wget https://s3.us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz

Extract the files:

tar -xvzf dynamodb_local_latest.tar.gz

After extraction, you’ll see files like DynamoDBLocal.jar and the DynamoDBLocal_lib directory.

Start DynamoDB Local

You can now start DynamoDB using the following command:

java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb

By default, DynamoDB runs on port 8000. Keep this terminal open while it runs.

Install AWS CLI (Optional)

To interact with DynamoDB using commands, install the AWS CLI:

sudo dnf install awscli -y

You can configure it (for local use, dummy credentials work fine):

aws configure

Verify DynamoDB is Running

Open another terminal and run this command:

aws dynamodb list-tables --endpoint-url http://localhost:8000

If DynamoDB is working properly, you’ll see an empty table list ([]).

Create a Sample Table

You can create a test table to confirm functionality:

aws dynamodb create-table \
  --table-name Users \
  --attribute-definitions AttributeName=UserID,AttributeType=S \
  --key-schema AttributeName=UserID,KeyType=HASH \
  --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 \
  --endpoint-url http://localhost:8000

Check that the table was created successfully:

aws dynamodb list-tables --endpoint-url http://localhost:8000

Run DynamoDB as a Background Service

If you want DynamoDB to start automatically on boot, create a systemd service file:

sudo nano /etc/systemd/system/dynamodb.service

Add the following configuration:

[Unit]
Description=DynamoDB Local Service
After=network.target

[Service]
ExecStart=/usr/bin/java -Djava.library.path=/home/centos/dynamodb/DynamoDBLocal_lib -jar /home/centos/dynamodb/DynamoDBLocal.jar -sharedDb
Restart=always
User=centos

[Install]
WantedBy=multi-user.target

Save and close, then enable and start the service:

sudo systemctl enable dynamodb
sudo systemctl start dynamodb

Check if it’s running properly:

sudo systemctl status dynamodb

Installing DynamoDB Local on CentOS 8 gives you a lightweight, server-side environment for developing and testing NoSQL applications without needing AWS access. It’s fast, reliable, and ideal for offline development and integration testing.

For CentOS VPS servers optimized for development, database performance, and cloud automation, visit DropVPS — a trusted hosting provider for developers and businesses.

Linux VPS
U
Loading...

Related Posts