{"id":2699,"date":"2024-09-06T05:12:36","date_gmt":"2024-09-06T03:12:36","guid":{"rendered":"https:\/\/raspberrytips.com\/?p=2699"},"modified":"2026-07-25T21:58:30","modified_gmt":"2026-07-25T19:58:30","slug":"autostart-a-program-on-boot","status":"publish","type":"post","link":"https:\/\/raspberrytips.com\/autostart-a-program-on-boot\/","title":{"rendered":"How to Auto Start a Program on Raspberry Pi? (4 Ways)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">You may want to launch a script or program on boot, but you don&#8217;t see an option for it on Raspberry Pi OS. It&#8217;s a question I often hear about, and the methods are not intuitive. In this post, I&#8217;ll show you several ways to accomplish this goal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>On Raspberry Pi OS, the easiest solution to start automatically a program on boot is to use the crontab with the @reboot event. There are also other methods using the Linux init systems.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So yes, it&#8217;s possible, but you&#8217;ll need to go with the solution that best fits your needs. You can choose to follow the &#8220;best practices&#8221; or just remember the simplest solution (that&#8217;s often my favorite). Let&#8217;s go!<\/p>\n\n\n<style>.kb-table-of-content-nav.kb-table-of-content-id19563_c031ec-35 .kb-table-of-content-wrap{padding-top:var(--global-kb-spacing-sm, 1.5rem);padding-right:var(--global-kb-spacing-sm, 1.5rem);padding-bottom:var(--global-kb-spacing-sm, 1.5rem);padding-left:var(--global-kb-spacing-sm, 1.5rem);background-color:var(--global-palette7, #EDF2F7);box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}.kb-table-of-content-nav.kb-table-of-content-id19563_c031ec-35 .kb-table-of-contents-title-wrap{padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id19563_c031ec-35 .kb-table-of-contents-title{font-weight:regular;font-style:normal;}.kb-table-of-content-nav.kb-table-of-content-id19563_c031ec-35 .kb-table-of-content-wrap .kb-table-of-content-list{font-size:var(--global-kb-font-size-sm, 0.9rem);font-weight:regular;font-style:normal;margin-top:var(--global-kb-spacing-sm, 1.5rem);margin-right:0px;margin-bottom:0px;margin-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id19563_c031ec-35 .kb-toggle-icon-style-basiccircle .kb-table-of-contents-icon-trigger:after, .kb-table-of-content-nav.kb-table-of-content-id19563_c031ec-35 .kb-toggle-icon-style-basiccircle .kb-table-of-contents-icon-trigger:before, .kb-table-of-content-nav.kb-table-of-content-id19563_c031ec-35 .kb-toggle-icon-style-arrowcircle .kb-table-of-contents-icon-trigger:after, .kb-table-of-content-nav.kb-table-of-content-id19563_c031ec-35 .kb-toggle-icon-style-arrowcircle .kb-table-of-contents-icon-trigger:before, .kb-table-of-content-nav.kb-table-of-content-id19563_c031ec-35 .kb-toggle-icon-style-xclosecircle .kb-table-of-contents-icon-trigger:after, .kb-table-of-content-nav.kb-table-of-content-id19563_c031ec-35 .kb-toggle-icon-style-xclosecircle .kb-table-of-contents-icon-trigger:before{background-color:var(--global-palette7, #EDF2F7);}<\/style>\n\n<p class='ml_begpost' id='ml_begpost_commands'>If you&#8217;re new to Raspberry Pi or Linux, I\u2019ve got something that can help you right away! <br \/><a rel='noopener' href='https:\/\/raspberrytips.com\/downloads\/?source=begpost&#038;lm=4' target='_blank'>Download my free Linux commands cheat sheet<\/a> \u2013 it\u2019s a quick reference guide with all the essential commands you\u2019ll need to get things done on your Raspberry Pi. <a rel='noopener' href='https:\/\/raspberrytips.com\/downloads\/?source=begpost&#038;lm=4' target='_blank'><b>Click here to get it for free!<\/b><\/a><\/p>\n\n\n<h2 class=\"wp-block-heading\">Methods to Run a Program at Startup<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In this first part, I&#8217;ll go directly to the main point: how to start any script or program on boot.<br>For the example, I&#8217;ll use my test script which is in my home folder, so <em>\/home\/pat\/test.sh<\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Don&#8217;t forget to make your script <a href=\"https:\/\/raspberrytips.com\/linux-commands-for-permissions\/\">executable via user permissions<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll need to change this line to the script or program you want to run. If you have no idea which command you need to input, read the second part of this guide :).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1 &#8211; Use Crontab<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Cron is a service automatically started at boot which allows the user to run scheduled tasks.<\/strong> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Cron is used in <a href=\"https:\/\/raspberrytips.com\/run-programs-on-startup-linux\/\">autostart methods across many Linux distros<\/a>. A crontab is a file that will allow us to list what we want to execute and when to start it, in a format understandable by the cron service.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The crontab has many settings to start a script at a specific time or schedule (daily, weekly, 3 times a month, etc.). I wrote another <a href=\"https:\/\/raspberrytips.com\/schedule-task-raspberry-pi\/\">post about scheduling tasks<\/a> that you can check out to learn more. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The crontab also gives us the option to launch a program on boot, with the @reboot option<\/strong>.<br>This is our first solution to starting a program automatically, and it&#8217;s probably the easiest one to remember from this list.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s how to launch a program at boot with crontab: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Open a terminal<\/strong>.<\/li>\n\n\n\n<li><strong>Open the crontab file:<br><\/strong><code>crontab -e<\/code><br>If&#8217;s your first time in the crontab, you need to select an editor (press Enter for nano).<br><img loading=\"lazy\" decoding=\"async\" width=\"1128\" height=\"348\" class=\"wp-image-13625\" style=\"\" src=\"https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/crontab-e.jpg\" alt=\"\" srcset=\"https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/crontab-e.jpg 1128w, https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/crontab-e-300x93.jpg 300w, https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/crontab-e-1024x316.jpg 1024w, https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/crontab-e-768x237.jpg 768w\" sizes=\"auto, (max-width: 1128px) 100vw, 1128px\" \/><\/li>\n\n\n\n<li>You&#8217;ll start with an empty crontab file that looks like this:<br><img loading=\"lazy\" decoding=\"async\" width=\"1327\" height=\"441\" class=\"wp-image-13624\" style=\"\" src=\"https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/crontab-1.jpg\" alt=\"\" srcset=\"https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/crontab-1.jpg 1327w, https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/crontab-1-300x100.jpg 300w, https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/crontab-1-1024x340.jpg 1024w, https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/crontab-1-768x255.jpg 768w\" sizes=\"auto, (max-width: 1327px) 100vw, 1327px\" \/><\/li>\n\n\n\n<li><strong>Add a line starting with @reboot, followed by the full path to your script, like this:<\/strong><br><code>@reboot \/home\/pat\/test.sh<\/code><\/li>\n\n\n\n<li><strong>Save and exit <\/strong>(CTRL+O, CTRL+X with nano).<br>(If you&#8217;re new to this, I have a guide that shows you <a href=\"https:\/\/raspberrytips.com\/nano-commands-shortcuts\/\" data-type=\"post\" data-id=\"2524\" target=\"_blank\" rel=\"noreferrer noopener\">the most important commands and shortcuts in Nano<\/a>.)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Your command is now scheduled to launch at each boot.<\/p>\n\n\n\n<p class=\"has-theme-palette-7-background-color has-background wp-block-paragraph\"><strong>Note<\/strong>: If you want to see task scheduling in action, I have a video lesson available just for community members. <a href=\"https:\/\/raspberrytips.com\/school\/community\/?coupon=IP25CTY&amp;utm_source=raspberrytips&amp;utm_medium=website&amp;utm_campaign=inpost\">Join here to watch<\/a> it directly! Becoming a member gives you access to 30+ other lessons for Raspberry Pi and comes with many other benefits.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2 &#8211; Put Your Script in \/etc\/init.d<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The second solution you can use is to place your script in the <em>\/etc\/init.d<\/em> directory. <\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I generally prefer this method for something like a service (<a aria-label=\"like a firewall script for example (opens in a new tab)\" data-lasso-id=\"891\" href=\"https:\/\/raspberrytips.com\/raspberry-pi-firewall\/\" target=\"_blank\" rel=\"noopener\">like for my firewall script, as explained here<\/a>). As I mentioned earlier, it&#8217;s not the best practice if you want to respect the Linux guidelines, but it works :).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, there&#8217;s still a format to follow for it to work correctly on boot.<br>Here&#8217;s how to do this:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Create a new file in \/etc\/init.d<\/strong>:<br><code>sudo nano \/etc\/init.d\/myservice<\/code><br>Change the file name to make it explicit.<\/li>\n\n\n\n<li><strong>Paste these lines <\/strong>(for example):<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">#!\/bin\/bash<br>### BEGIN INIT INFO<br># Provides: MyService<br># Required-Start:    $all<br># Required-Stop: <br># Default-Start:     5 <br># Default-Stop:      6 <br># Short-Description: Your service description<br>### END INIT INFO<br><br>touch \/home\/pat\/myservice_test<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The comments at the beginning are mandatory to make it start on boot (runlevel 5).<br>Change the service name and description to explain what your script should do.<\/li>\n\n\n\n<li><strong>Save &amp; exit<\/strong> (CTRL+X).<\/li>\n\n\n\n<li><strong>Add the execution permission<\/strong> to your script:<br><code>sudo chmod +x \/etc\/init.d\/myservice<\/code><\/li>\n\n\n\n<li>Finally, <strong>tell the system to start it on boot<\/strong> by using this command:<br><code>sudo update-rc.d myservice defaults<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s the minimum to make it work. The goal here is just to run a script on boot. Reboot to try. If all is correct, your script should run once every time you start your Raspberry Pi.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>If you want to set this up more properly, you can add start, stop and restart options to your service<\/strong>. You can find a detailed <a data-lasso-id=\"892\" href=\"https:\/\/www.linux.com\/tutorials\/managing-linux-daemons-init-scripts\/\" target=\"_blank\" rel=\"noopener\">documentation here<\/a> if that&#8217;s what you want to do.<\/p>\n\n\n\r\n\t\t<!-- wp:paragraph -->\r\n\t<p  id=\"inpost_lm_linux_commands\"><b>Tip: <\/b> Command lines can be a pain to memorize. I put the essential Linux commands on a printable cheat sheet so you don't have to keep googling them.\u00a0You can <a rel=\"noreferrer noopener\" href=\"https:\/\/raspberrytips.com\/downloads\/?source=rb_linux&lm=4\" target=\"_blank\">grab the PDF here<\/a> if you want to save some time.<\/p>\r\n\t<!-- \/wp:paragraph -->\r\n\t\t\n\n\n<h3 class=\"wp-block-heading\">3 &#8211; Create a Systemd Service<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The third option is to create a systemd service.<\/strong> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Some might consider this the most proper way. It lets you control your program using <a href=\"https:\/\/raspberrytips.com\/systemctl-linux-command\/\">the &#8216;systemctl&#8217; command<\/a>, just like you would for other services like <a href=\"https:\/\/raspberrytips.com\/use-vnc-raspberry-pi\/\" data-type=\"post\" data-id=\"10674\">VNC<\/a>, <a href=\"https:\/\/raspberrytips.com\/nginx-on-raspberry-pi\/\" data-type=\"link\" data-id=\"https:\/\/raspberrytips.com\/nginx-on-raspberry-pi\/\">Nginx<\/a>, or <a href=\"https:\/\/raspberrytips.com\/install-cloudflared-raspberry-pi\/\">cloudflared<\/a>. However, it does have a specific format you need to follow below.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s how to create a systemd service that runs on startup:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Create a file in \/lib\/systemd\/system<\/strong>:<br><code>sudo nano \/lib\/systemd\/system\/mytest.service<\/code><\/li>\n\n\n\n<li><strong>Paste the following lines<\/strong>:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">[Unit]<br>Description=MyService<br>After=multi-user.target<br><br>[Service]<br>Type=idle<br>ExecStart=\/home\/pat\/test.sh<br><br>[Install]<br>WantedBy=multi-user.target<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Change ExecStart <\/strong>to the full path to your command, and <strong>Description <\/strong>to remember what it is.<\/li>\n\n\n\n<li><strong>Save &amp; exit<\/strong> (CTRL+X).<\/li>\n\n\n\n<li><strong>Modify the service file&#8217;s permissions<\/strong> to match other system services:<br><code>sudo chmod 644 \/lib\/systemd\/system\/mytest.service<\/code><\/li>\n\n\n\n<li>Finally, <strong>tell systemd to run it at boot<\/strong>:<br><code>sudo systemctl enable mytest.service<\/code><br><br><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"26\" class=\"wp-image-32305\" style=\"width: 700px;\" src=\"https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/systemctl_enable-e1725573126906.jpg\" alt=\"systemctl enable command\" srcset=\"https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/systemctl_enable-e1725573126906.jpg 907w, https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/systemctl_enable-e1725573126906-300x11.jpg 300w, https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/systemctl_enable-e1725573126906-768x29.jpg 768w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s all! When you reboot, your program should run after all key system services have started.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4 &#8211; Add a Line to \/etc\/rc.local<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The rc.local file is a script intended for the system administrator<\/strong> (you!).<br>On boot, it&#8217;s one of the last things executed (at the end of the multi-user run level).<br>So, it&#8217;s exactly what you need to run a custom service.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is how to use it:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Open the rc.local file<\/strong>.<br><code>sudo nano \/etc\/rc.local<\/code><\/li>\n\n\n\n<li><strong>Insert script or service <\/strong>just before the &#8220;exit 0&#8221; line<br>Something like this:<br><img loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"239\" class=\"wp-image-32308\" style=\"width: 650px;\" src=\"https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/rclocal_startup_script.jpg\" alt=\"rclocal startup script\" srcset=\"https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/rclocal_startup_script.jpg 465w, https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/rclocal_startup_script-300x110.jpg 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/li>\n\n\n\n<li><strong>Don&#8217;t forget the ampersand(&amp;) symbol at the end<\/strong>, or it might not work!<\/li>\n\n\n\n<li><strong>Save and exit<\/strong> (CTRL+X).<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;re done\u2014there&#8217;s nothing else to do. You can reboot now to try it out if you want.<\/p>\n\n\n\n<p class=\"has-theme-palette-7-background-color has-background wp-block-paragraph\"><strong>Note<\/strong>: On the newest Raspberry Pi OS (trixie), using rc.local is discouraged. However, it&#8217;s still possible using the method below.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s how to do it on Trixie: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Create the rc.local file: <\/strong><br><code>sudo nano \/etc\/rc.local<\/code><\/li>\n\n\n\n<li><strong>Add the lines below<\/strong>:<br>(Don&#8217;t forget to replace the path below with your script.)<br><code>!\/bin\/sh -e<br><br>\/home\/pat\/test1.sh &amp;<br><br>exit 0<\/code><\/li>\n\n\n\n<li><strong>Save and exit<\/strong> (CTRL+X).<\/li>\n\n\n\n<li><strong>Make the rc.local file executable: <\/strong><br><code>sudo chmod +x \/etc\/rc.local<\/code><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Finding the Command to Auto-Start<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Before trying to auto-start a program on boot, you may need some help knowing exactly what to run.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sadly, Raspberry Pi OS doesn&#8217;t include a tool to start apps on boot, so you&#8217;ll have to find the command that launches the program. In this section, I&#8217;ll go over three ways to find it. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Provide Your Script Path<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>If your goal is to run a script on boot, the command is easy to find: it&#8217;s the path to the script<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, let&#8217;s say you created a script that resides in \/usr\/local\/bin with the name start_script.sh.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For it to run boot, make sure that your script is executable. You can add the permission with:<br><code>chmod +x \/usr\/local\/bin\/start_script.sh<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Now you can input this command into one of the solutions above to run on boot:<\/strong><br><code>\/usr\/local\/bin\/start_script.sh<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Find the Executable<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A second option is to run an executable command on boot.<\/strong> This is an easy solution if you know exactly what you want to do. The only difficulty you might run into involves the path.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Each command (htop, nano, mail, etc.) is installed at a specific location on your system (\/usr\/local\/bin, \/usr\/bin, etc.)<\/strong>. Most system commands will run properly on boot even if you don&#8217;t specify a path. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But for some programs, like lesser-known GitHub projects or things like that (I&#8217;m thinking about <a href=\"https:\/\/raspberrytips.com\/install-log2ram-raspberry-pi\" data-type=\"link\" data-id=\"https:\/\/raspberrytips.com\/install-log2ram-raspberry-pi\">Log2Ram<\/a> for example), this is not the case. Instead, you have to provide the complete path.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you have no idea where the executable location is, here are a few tips. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can use the &#8220;which&#8221; command to find it:<br><code>which &lt;COMMAND&gt;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s an example:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"444\" src=\"https:\/\/raspberrytips.com\/wp-content\/uploads\/2022\/10\/find-php-1024x444.jpg\" alt=\"command which php to find paths\" class=\"wp-image-13628\" style=\"width:auto;height:300px\" srcset=\"https:\/\/raspberrytips.com\/wp-content\/uploads\/2022\/10\/find-php-1024x444.jpg 1024w, https:\/\/raspberrytips.com\/wp-content\/uploads\/2022\/10\/find-php-300x130.jpg 300w, https:\/\/raspberrytips.com\/wp-content\/uploads\/2022\/10\/find-php-768x333.jpg 768w, https:\/\/raspberrytips.com\/wp-content\/uploads\/2022\/10\/find-php.jpg 1087w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Now that you&#8217;ve found the path, you can input &#8220;\/usr\/bin\/php&#8221; in your autostart file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If &#8220;which&#8221; didn&#8217;t work, the &#8220;find&#8221; command may be helpful to find a program:<br><code>sudo find \/ -iname php<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you need more details about this, you should probably read my other article here: <a href=\"https:\/\/raspberrytips.com\/find-file-raspberry-pi\/\" data-type=\"post\" data-id=\"5451\">3 Commands to Search For a File on Raspberry Pi (and find it!)<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">View the Menu Shortcut<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>My last method works for graphical programs that you run directly from the Raspberry Pi OS main menu.<\/strong> Since you can&#8217;t see the shortcut&#8217;s location, it&#8217;s difficult to find the executable file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But there&#8217;s an easy way to locate it:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the <strong>Pi menu > Preferences > <a href=\"https:\/\/raspberrytips.com\/raspberry-pi-control-centre\/\">Control Centre<\/a><\/strong>.<\/li>\n\n\n\n<li>Go to the <strong>Main Menu<\/strong> tab. <\/li>\n\n\n\n<li>This tool allows you to choose which shortcuts you want in the main menu.<br><img decoding=\"async\" src=\"https:\/\/raspberrytips.com\/wp-content\/uploads\/2025\/11\/rpios_trixie_menu_editor2.jpg\" alt=\"\"><\/li>\n\n\n\n<li><strong>Find the application you want to start<\/strong>.<br>There are sorted in the same order as on the main menu, so browse through the categories.<\/li>\n\n\n\n<li>Then click <strong>Edit Item<\/strong> on the right. <br>A window shows up with the launcher properties.<br><img decoding=\"async\" src=\"https:\/\/raspberrytips.com\/wp-content\/uploads\/2024\/09\/rpios_menueditor_command.jpg\" alt=\"\"><br><strong>In the Command field, you can see the exact command <\/strong>used when you click on it in the main menu.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Now you have everything you need to apply one of the four solutions we discussed earlier.<br>If you need the path location, check my previous tip with the <em>which <\/em>command.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s it\u2014you now know <strong>four ways to automatically start a program on boot<\/strong>. Choose your preferred solution depending on what your program is, or maybe just choose the method you remember most easily.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you know of other methods, easier or not, I&#8217;d like to know about them. Please <a href=\"https:\/\/raspberrytips.com\/community\" target=\"_blank\" rel=\"noreferrer noopener\">leave a message in the community<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;re now ready to create your own scripts and program them to run on boot! If you need more help on the programming side of things, I have a few articles waiting for you:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/raspberrytips.com\/top-text-editors-on-raspberry-pi\/\" data-type=\"post\" data-id=\"5318\">The 7 Best Text Editors for Programming on Raspberry Pi<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/raspberrytips.com\/learn-linux-or-python-first\/\" data-type=\"post\" data-id=\"9369\">Should You Learn Linux or Python first?<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/raspberrytips.com\/python-projects-on-raspberry-pi\/\" data-type=\"post\" data-id=\"8236\">15 Fun Raspberry Pi Projects to Experiment with Python<\/a><\/li>\n<\/ul>\n\n\n<section id=\"end-block-pi\">\r\n<div class=\"rt-community-card \">\r\n\t<div class=\"rt-community-card__inner\">\r\n\r\n\t\t<div class=\"rt-community-card__main\">\r\n\t\t\t<h3 class=\"rt-community-card__headline\">\r\n\t\t\t\tNot getting the same result?\t\t\t<\/h3>\r\n\r\n\t\t\t<p class=\"rt-community-card__description\">\r\n\t\t\t\tEven when you follow every step, small differences in OS version, hardware or config can change the outcome. Instead of wasting time guessing, get help from people who have already fixed the same kind of issue.\t\t\t<\/p>\r\n\r\n\t\t\t<div class=\"rt-community-card__actions\">\r\n\t\t\t\t<a class=\"rt-community-card__button\" href=\"https:\/\/raspberrytips.com\/school\/community\/?coupon=EBCTY\">\r\n\t\t\t\t\t<span>Ask your question now<\/span>\r\n\t\t\t\t\t<span class=\"rt-community-card__button-arrow\">\u2192<\/span>\r\n\t\t\t\t<\/a>\r\n\r\n\t\t\t\t\t\t\t\t\t<div class=\"rt-community-card__small\">\r\n\t\t\t\t\t\t<span class=\"rt-community-card__small-lock\">\ud83d\udd12<\/span>\r\n\t\t\t\t\t\tNo risk. Cancel anytime.\t\t\t\t\t<\/div>\r\n\t\t\t\t\t\t\t<\/div>\r\n\t\t<\/div>\r\n\r\n\t\t\t\t\t<div class=\"rt-community-card__side\">\r\n\t\t\t\t<ul class=\"rt-community-card__benefits\">\r\n\t\t\t\t\t\t\t\t\t\t\t<li>Get help on your exact issue<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t<li>Access step-by-step videos for tricky setups<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t<li>Browse the website without ads<\/li>\r\n\t\t\t\t\t\t\t\t\t<\/ul>\r\n\t\t\t<\/div>\r\n\t\t\r\n\t<\/div>\r\n<\/div>\r\n<\/section>\r\n\r\n<style>\r\n.rt-community-card {\r\n\t--rt-bg: #f7f7f9;\r\n\t--rt-border: #e4e4e8;\r\n\t--rt-text: #15171b;\r\n\t--rt-muted: #5b6270;\r\n\t--rt-accent: #C61E4A;\r\n\t--rt-accent-hover: #aa183f;\r\n\t--rt-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);\r\n\r\n\tmargin: 36px 0;\r\n\tcolor: var(--rt-text);\r\n\tfont-family: inherit;\r\n}\r\n\r\n.rt-community-card__inner {\r\n\tdisplay: grid;\r\n\tgrid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.95fr);\r\n\tgap: 34px;\r\n\talign-items: start;\r\n\tbackground: var(--rt-bg);\r\n\tborder: 1px solid var(--rt-border);\r\n\tborder-radius: 22px;\r\n\tpadding: 34px 36px;\r\n\tbox-shadow: var(--rt-shadow);\r\n}\r\n\r\n.rt-community-card__main {\r\n\tmin-width: 0;\r\n}\r\n\r\n.rt-community-card__side {\r\n\tborder-left: 1px solid #e1e1e6;\r\n\tpadding-left: 28px;\r\n}\r\n\r\n.rt-community-card__benefits {\r\n\tmargin: 6px 0 0;\r\n\tpadding: 0;\r\n\tlist-style: none;\r\n\tdisplay: grid;\r\n\tgap: 18px;\r\n}\r\n\r\n.rt-community-card__benefits li {\r\n\tposition: relative;\r\n\tpadding-left: 18px;\r\n\tfont-size: 18px;\r\n\tline-height: 1.55;\r\n\tcolor: var(--rt-text);\r\n}\r\n\r\n.rt-community-card__benefits li::before {\r\n\tcontent: \"\";\r\n\tposition: absolute;\r\n\tleft: 0;\r\n\ttop: 0.72em;\r\n\twidth: 7px;\r\n\theight: 7px;\r\n\tborder-radius: 999px;\r\n\tbackground: var(--rt-accent);\r\n\ttransform: translateY(-50%);\r\n}\r\n\r\n.rt-community-card__actions {\r\n\tdisplay: flex;\r\n\tflex-direction: column;\r\n\talign-items: flex-start;\r\n\tgap: 10px;\r\n\tmargin-top: 30px;\r\n}\r\n\r\n.rt-community-card__button {\r\n\tdisplay: inline-flex;\r\n\talign-items: center;\r\n\tjustify-content: center;\r\n\tgap: 10px;\r\n\tmin-height: 60px;\r\n\tpadding: 0 28px;\r\n\tborder-radius: 14px;\r\n\tbackground: var(--rt-accent);\r\n\tcolor: #fff !important;\r\n\ttext-decoration: none !important;\r\n\tfont-size: 21px;\r\n\tfont-weight: 700;\r\n\tline-height: 1;\r\n\tbox-shadow: 0 12px 22px rgba(198, 30, 74, 0.22);\r\n\ttransition: background .2s ease, transform .2s ease, box-shadow .2s ease;\r\n}\r\n\r\n.rt-community-card__button:hover {\r\n\tbackground: var(--rt-accent-hover);\r\n\tcolor: #fff !important;\r\n\ttransform: translateY(-1px);\r\n\tbox-shadow: 0 14px 26px rgba(198, 30, 74, 0.28);\r\n}\r\n\r\n.rt-community-card__button-arrow {\r\n\tfont-size: 20px;\r\n\tline-height: 1;\r\n}\r\n\r\n.rt-community-card__small {\r\n\tfont-size: 15px;\r\n\tline-height: 1.5;\r\n\tcolor: #6a717d;\r\n\tpadding-left: 2px;\r\n}\r\n\r\n.rt-community-card__small-lock {\r\n\tmargin-right: 6px;\r\n\tfont-size: 14px;\r\n\tvertical-align: baseline;\r\n}\r\n\r\n\/* Tablet *\/\r\n@media (max-width: 900px) {\r\n\t.rt-community-card {\r\n\t\tmargin: 28px 0;\r\n\t}\r\n\r\n\t.rt-community-card__inner {\r\n\t\tgrid-template-columns: 1fr;\r\n\t\tgap: 24px;\r\n\t\tpadding: 28px 24px;\r\n\t}\r\n\r\n\t.rt-community-card__side {\r\n\t\tborder-left: 0;\r\n\t\tborder-top: 1px solid #e1e1e6;\r\n\t\tpadding-left: 0;\r\n\t\tpadding-top: 22px;\r\n\t}\r\n\r\n\t.rt-community-card__benefits {\r\n\t\tgrid-template-columns: 1fr;\r\n\t\tgap: 12px;\r\n\t}\r\n}\r\n\r\n\/* Mobile *\/\r\n@media (max-width: 640px) {\r\n\t.rt-community-card__inner {\r\n\t\tpadding: 22px 18px;\r\n\t\tborder-radius: 18px;\r\n\t\tgap: 20px;\r\n\t}\r\n\t\r\n\t.rt-community-card__side {\r\n\t\tpadding-top: 18px;\r\n\t}\r\n\r\n\t.rt-community-card__benefits li {\r\n\t\tfont-size: 16px;\r\n\t}\r\n\r\n\t.rt-community-card__actions {\r\n\t\tmargin-top: 24px;\r\n\t\talign-items: stretch;\r\n\t}\r\n\r\n\t.rt-community-card__button {\r\n\t\twidth: 100%;\r\n\t\tmin-height: 56px;\r\n\t\tfont-size: 18px;\r\n\t\tpadding: 0 20px;\r\n\t}\r\n\r\n\t.rt-community-card__small {\r\n\t\ttext-align: center;\r\n\t\tpadding-left: 0;\r\n\t}\r\n}\r\n<\/style>\r\n\t\r\n","protected":false},"excerpt":{"rendered":"<p>You may want to launch a script or program on boot, but you don&#8217;t see an option for it on Raspberry Pi OS. It&#8217;s a question I often hear about, and the methods are not intuitive. In this post, I&#8217;ll show you several ways to accomplish this goal. On Raspberry Pi OS, the easiest solution&#8230;<\/p>\n","protected":false},"author":1,"featured_media":32312,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[2],"tags":[],"class_list":["post-2699","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to-tutorials"],"taxonomy_info":{"category":[{"value":2,"label":"How-To Tutorials"}]},"featured_image_src_large":["https:\/\/raspberrytips.com\/wp-content\/uploads\/2019\/09\/banner_autostart_pi-1024x683.jpg",1024,683,true],"author_info":{"display_name":"Patrick Fromaget","author_link":"https:\/\/raspberrytips.com\/author\/admin\/"},"comment_info":7,"category_info":[{"term_id":2,"name":"How-To Tutorials","slug":"how-to-tutorials","term_group":0,"term_taxonomy_id":2,"taxonomy":"category","description":"","parent":0,"count":228,"filter":"raw","cat_ID":2,"category_count":228,"category_description":"","cat_name":"How-To Tutorials","category_nicename":"how-to-tutorials","category_parent":0}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/raspberrytips.com\/wp-json\/wp\/v2\/posts\/2699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberrytips.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberrytips.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberrytips.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberrytips.com\/wp-json\/wp\/v2\/comments?post=2699"}],"version-history":[{"count":39,"href":"https:\/\/raspberrytips.com\/wp-json\/wp\/v2\/posts\/2699\/revisions"}],"predecessor-version":[{"id":54181,"href":"https:\/\/raspberrytips.com\/wp-json\/wp\/v2\/posts\/2699\/revisions\/54181"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/raspberrytips.com\/wp-json\/wp\/v2\/media\/32312"}],"wp:attachment":[{"href":"https:\/\/raspberrytips.com\/wp-json\/wp\/v2\/media?parent=2699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberrytips.com\/wp-json\/wp\/v2\/categories?post=2699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberrytips.com\/wp-json\/wp\/v2\/tags?post=2699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}