Configure environment variables
Create a Update the following required variables in your
.env file in the root directory using the example template:.env file:.env
Start the server
http://localhost:5050 (or your configured PORT).Docker Compose automatically sets up PostgreSQL. For local development, ensure you have PostgreSQL installed and running.
Create your first user
Register a new user account:Response:
cURL
New users get default limits: 100 files and 1GB storage.
Upload your first file
Upload a file using your authentication token:Response:
cURL
Files are stored in
DATA_PATH/uploads/username/ by default. The file is private by default.Next Steps
Now that you have DefDrive running, explore these features:Authentication
Learn about JWT tokens and securing your API requests
Access Control
Configure IP restrictions, TTL, and one-time links
File Management
Understand file storage, limits, and organization
API Reference
Explore all available endpoints and parameters
Common Issues
Database connection failed
Database connection failed
Ensure PostgreSQL is running and the
DATABASE_URL or individual database environment variables are correctly set in your .env file.For Docker Compose, the database service must be healthy before the app starts. Check logs:File upload fails with 'Storage limit exceeded'
File upload fails with 'Storage limit exceeded'
Check your current usage and limits:Default limits are 100 files and 1GB storage. See User Limits to adjust these values.
Token expired or invalid
Token expired or invalid
JWT tokens expire after 72 hours (configured in
controllers/user.go:80). Login again to get a fresh token:Need more help? Check the Installation Guide or explore the API Reference for detailed endpoint documentation.