I need to check the runtime logs for the ubuntu droplet, I tried to use the cli with doctl apps list
but it returns an empty table, and I dont know the droplet id so I can’t do doclt logs <id>
.
Thank you
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hi there,
The
doctl apps list
command you tried before is for listing deployed apps on the DigitalOcean App Platform, which is a different service than Droplets. Hence, it didn’t show your Droplet details.Here are the steps to access runtime logs for an Ubuntu Droplet:
Find Your Droplet’s ID: First, list all your droplets to find the ID of the droplet you’re interested in.
This will show you a list of droplets along with their IDs, names, public IPs, etc. Locate your droplet in this list and note down its ID.
SSH into Your Droplet: After identifying the Droplet ID and its associated IP, SSH into the droplet using the command:
Replace
YOUR_DROPLET_IP
with the IP address of your droplet.Once you’re in the Droplet, it will depend on which logs you need to check but here are some general guidelines. You can check system logs using the
journalctl
command:If you’d like to view logs for a specific service, for example,
nginx
, you can use:Other Useful Logs: Ubuntu stores logs in the
/var/log/
directory. Some useful logs in this directory include:/var/log/syslog
: System log/var/log/auth.log
: Authentication logs/var/log/apache2/
: Apache web server logs (if you have Apache installed)/var/log/nginx/
: Nginx web server logs (if you have Nginx installed)To view these logs, you can use any text editor or utilities like
cat
,less
, ortail
. For instance:The above command will show the last few lines of the syslog and update in real-time.
Exit Your Droplet: Once you’re done, simply type
exit
to leave the SSH session.Hope that this helps!
Best,
Bobby