sqlite
Create a SQLite database file in a hosted site's
sqlitefolder and register it in GoAdmio with a generated access password, or remove that registration
- Command:
/go/sqlite - Category: Databases
- Required arguments:
<domain>and<name> - Output: One confirmation line
- Last updated: 2026-11-21
On this page: Overview · Quick start · Syntax · Arguments · Output · Examples · Troubleshooting · Details · Risks · See also
Overview
SQLite keeps a whole database in one file, so a website can use it without a database server. /go/sqlite prepares such a database for a hosted domain. It:
- creates the file
/home/<domain>/sqlite/<name>.dbwith a small starting table - gives the file to the site's user
- records the database, with a generated password, in GoAdmio's registry at
/var/lib/sqlite/sqlite.db
It can also remove the registry entry again with the delete action.
[!WARNING] Creating a database makes the whole
sqlitefolder of the domain readable and writable by every user on the server. See Risks for how to tighten this.
[!WARNING] To remove an entry,
deletemust be the third argument./go/sqlite example.com deletedoes not delete anything. It creates a database nameddelete.
Quick start
# Create a database called mydb for example.com
/go/sqlite example.com mydb
The file is created as /home/example.com/sqlite/mydb.db. A PHP site can open it with sqlite:/home/example.com/sqlite/mydb.db.
Syntax
# Create
/go/sqlite <domain> <name>
# Remove the registry entry
/go/sqlite <domain> <name> delete
The command writes the call and a timestamp to /var/log/go/sqlite.log. Run it as root.
Arguments
| Position | Argument | Required | Notes |
|---|---|---|---|
| 1 | <domain> |
Yes | The hosted domain. Its account username is looked up from it. |
| 2 | <name> |
Yes | The database name. The file is called <name>.db. Use letters, numbers, _, and - only. |
| 3 | delete |
To remove | Removes the registry entry. Any other value, or none, creates. |
Nothing is checked. The command does not test that the domain is hosted on this server. A misspelled domain creates a new /home/<domain>/sqlite folder. A name or domain with / or .. in it can create files in other places.
Output
Creating:
Database mydb created successfully...
Removing:
SQLite Access deleted successfully.
Both messages are printed even if the step did nothing, for example when the database already existed. The generated password is not printed.
Examples
# Create a database
/go/sqlite example.com mydb
# Remove its registry entry (delete is the third argument)
/go/sqlite example.com mydb delete
# Look at the files
ls -l /home/example.com/sqlite
# Open the database and look at its tables
sqlite3 /home/example.com/sqlite/mydb.db ".tables"
# Delete the database file itself (the command does not do this)
rm /home/example.com/sqlite/mydb.db
# Look up the stored password for a domain's databases
sudo sqlite3 /var/lib/sqlite/sqlite.db "select Name, Pass from SQLite where Domain='example.com'"
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
A database named delete was created |
delete was the second argument. |
Run /go/sqlite <domain> <name> delete, using delete as the name, to remove its entry, then remove the file by hand. |
After delete, the .db file is still there |
delete only removes the registry entry. |
Remove the file with rm. |
A new folder appeared under /home |
The domain was misspelled, so the command created the folder. | Check that it is empty, then remove it. |
sqlite3: command not found |
SQLite is not installed. | Install it with installsqlite. |
| I don't know the password | It is not printed. | Look it up in GoAdmio, or with the last command in Examples. |
| The same name appears twice in the registry | Running the command again for the same name adds another entry with a new password. | Remove the entries with delete, then create it again. |
| Other accounts can read or change the database | The folder is set to 777. |
See Risks. |
Details
What it does
- Records the call in
/var/log/go/sqlite.log. - Looks up the account's username from the
Sitetable in/var/lib/sqlite/site.db. - Removing (third argument is
delete): deletes the entry that matches the name and domain from theSQLitetable in/var/lib/sqlite/sqlite.db, and prints the confirmation. - Creating (anything else):
- Creates
/home/<domain>/sqliteif it is missing. - If
<name>.dbdoes not exist, creates it with a table namedSQLitethat holds one row: the SQLite version and a timestamp. An existing file is left as it is. - Sets the permissions of the whole folder and its files to
777, and the owner to the site's user. - Generates a random 16-character password.
- Adds an entry with the name, domain, username, password, and time to the registry.
- Prints the confirmation.
- Creates
flowchart TD
A["sqlite domain name [delete]"] --> B["Look up the site's username"]
B --> C{"Third argument is delete?"}
C -- "Yes" --> D["Delete the registry entry, print confirmation"]
C -- "No" --> E["Create the sqlite folder if missing"]
E --> F["Create name.db if it does not exist"]
F --> G["chmod 777 and chown the folder"]
G --> H["Generate password, add registry entry, print confirmation"]
What is created
| Item | Location |
|---|---|
| The database file | /home/<domain>/sqlite/<name>.db, outside the website's www folder, so it cannot be downloaded from the web |
| The registry entry | The SQLite table in /var/lib/sqlite/sqlite.db: name, domain, username, password, time |
| The starting table | A table called SQLite in the new file, with ID, Version, and TimeStamp columns |
A SQLite file has no password of its own. The generated password is recorded for GoAdmio's SQLite access.
Risks
-
chmod -R 777is run on the wholesqlitefolder, so every file in it, including databases of other names, can be read, changed, or deleted by any user on the server. If nothing else needs this, tighten it after you run the command:chmod -R u+rwX,go-rwx /home/example.com/sqlite -
The password is saved as plain text in
/var/lib/sqlite/sqlite.db. -
Input is not validated. Names and domains containing
/,.., or a quote character can create files in the wrong place or break the registry command. -
deletedoes not remove data. Anyone who still has the file keeps access to it.
See also
| Command | Description |
|---|---|
installsqlite |
Install the latest SQLite version on a GoAdmio server |
mysql |
Create, edit, or delete a MySQL/MariaDB database and user for a hosting account |
postgre |
Create, edit, or delete a PostgreSQL database and user |
create |
Create a GoAdmio account (this creates the sqlite folder) |
fix |
Reset ownership and permissions for one account or all accounts |
backup |
Back up one or all GoAdmio accounts |