# How to remotely connect to the stardog database

**URL:** <https://community.stardog.com/t/how-to-remotely-connect-to-the-stardog-database/5375>\
**Category:** Stardog Studio\
**Created:** [May 20, 2025, 11:33am UTC](https://community.stardog.com/t/how-to-remotely-connect-to-the-stardog-database/5375 "2025-05-20T11:33:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![deng](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@deng](https://community.stardog.com/u/deng)\
**Post date:** [May 20, 2025, 11:33am UTC](https://community.stardog.com/t/how-to-remotely-connect-to-the-stardog-database/5375/1 "2025-05-20T11:33:05Z")

</div>

How to modify the following code for remote connection to the stardog database or knowledge graph. Are the username and password for the remote connection the same as those when creating the stardog cloud account?

date=$(date +'%d\_%m\_%Y')  
echo "Available Hosts (cadets, theia, trace, optc)"  
read -p "Enter the host name:" dataset  
read -p "Enter the stardog dataset name:" stardogDataseet  
read -p "Enter the stardog username:" stardogUserName  
read -p "Enter the stardog password:" stardogpassword  
read -p "Enter the turtle provenance graphs folder path:" PG\_path  
mkdir -p logs/${dataset}/  
load\_graph () {  
graph\_name=$1  
echo ${graph\_name}.ttl \>\> logs/${dataset}/loading\_${dataset}_provenance\_graph_${date}.txt  
stardog data add ${stardogDataseet} ${PG\_path}/${graph\_name}.ttl -u ${stardogUserName} -p ${stardogpassword} \>\> logs/${dataset}/loading\_${dataset}_provenance\_graph_${date}.txt

}

---

<div class="post-metadata">

**Author:** ![Laura\_Firey](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/laura_firey/32/635_2.png) [@Laura\_Firey](https://community.stardog.com/u/Laura_Firey)\
**Post date:** [May 20, 2025, 8:33pm UTC](https://community.stardog.com/t/how-to-remotely-connect-to-the-stardog-database/5375/2 "2025-05-20T20:33:48Z")

</div>

You can set up a username/password for your user or a service account following directions in our docs [here](https://docs.stardog.com/stardog-cloud/inviting-configuring-users#user-configuration).

Stardog Cloud also has programmatic access. More details can be found in our docs: [Accessing API Endpoint | Stardog Documentation Latest](https://docs.stardog.com/stardog-cloud/accessing-api-endpoint)
