Starting the Uvicorn server with uv:
uv run uvicorn app.main:app --host 0.0.0.0 --port 8001
This command starts the server on port 8001, accessible from any IP address.
A comprehensive cheat sheet for managing server-side deployments using Localweb, covering essential commands, configurations, and monitoring techniques. Includes Nginx and Systemd configurations.
|
Starting the Uvicorn server with
This command starts the server on port 8001, accessible from any IP address. |
|
Enabling auto-reload:
The |
|
Setting the log level:
Adjust the |
|
Gracefully stopping the server:
Sends a SIGTERM signal, allowing the server to shut down gracefully. Replace |
|
Avoid using This sends a SIGKILL signal, which immediately terminates the process without allowing it to clean up resources or finish ongoing tasks. |
|
Swagger UI:
Interactive API documentation. |
|
ReDoc:
Alternative API documentation viewer. |
|
Editing the Nginx configuration file:
This opens the configuration file for the |
|
Example Configuration:
|
|
Testing the configuration:
Checks the Nginx configuration file for syntax errors. |
|
Reloading Nginx:
Applies the changes without interrupting existing connections. |
|
Creating the Systemd service file:
This creates a service file to manage the backend application. |
|
Example Service File Configuration:
|
|
Reloading Systemd daemon:
This reloads the systemd manager configuration. |
|
Starting the service:
Starts the |
|
Restarting the service:
Restarts the |
|
Checking the service status:
Displays the current status and logs of the |
|
Defining the alias:
This creates an alias named To make it permanent, add this line to your |
|
Applying the alias:
Reloads the shell configuration to make the alias available in the current session. |
|
Navigating to the directory:
This command will change the current directory to |