Cloud-init lets you turn a new Linux VPS into a usable server on its first boot. You provide user-data when the instance is created; cloud-init reads that data and can create a non-root administrator, install an SSH key and packages, write configuration files, set the hostname and locale, configure networking, and run commands.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
The reliable workflow is: select an image that includes cloud-init, prepare valid YAML or an executable script, establish key-based SSH access before doing anything else, attach the data during provisioning, and verify the result in the cloud-init logs. The same process works across providers, but image support, input fields, command-line options, logging, and whether user-data can be changed later are provider-specific.
As an Amazon Associate I earn from qualifying purchases.
Recommended Free Tools
What cloud-init does on a new VPS
Cloud-init is the first-boot automation system used by many Linux cloud images. A cloud or VPS provider passes your user-data to the instance; cloud-init consumes it during its initialization stages and applies the requested changes. Ubuntu describes it as the package that handles early initialization of a cloud instance.
Typical tasks include:
- Creating a named user and adding it to an administrative group.
- Installing an SSH public key so you can log in without a password.
- Updating the package index, upgrading installed packages, and installing software.
- Writing files such as service configuration, login messages, or application settings.
- Setting a hostname, locale, or other operating-system defaults.
- Running commands after earlier configuration has completed.
Cloud-init is not a general-purpose configuration-management server. Most user-data is consumed once per instance, so it is best for bootstrapping a machine and handing it off to a repeatable administration process.
#1 Best Overall
- BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
- EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
- COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
- LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
- WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
Confirm that the VPS image and provider support cloud-init
Your script cannot run if the selected image does not contain an enabled cloud-init installation or if the provider never passes user-data to the instance. Check the image description and provisioning documentation before you create the VPS. DigitalOcean, for example, states that its latest Ubuntu and CentOS images support cloud-init; an image without cloud-init will not automatically consume user-data.
Use this preflight checklist:
- Choose a current Linux image identified as cloud-init-enabled.
- Confirm which distribution user is created by the image and how provider-injected SSH keys are applied.
- Find the provider’s user-data entry point: a control-panel field, an API property, a CLI option, or more than one.
- Check whether the provider accepts cloud-config YAML, a shell script, MIME multipart data, or all three.
- Record where the provider and operating system expose boot logs.
- Determine whether user-data can be edited after creation. DigitalOcean documents that its Droplet user-data cannot be modified after the Droplet is created.
When comparing cloud VPS hosting, image compatibility and the user-data interface matter as much as CPU, memory, and disk. A provider that accepts the same version-controlled file through both an API and a CLI is easier to automate than one that only offers a manually pasted field.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Choose the right user-data format
Cloud-init recognizes different formats, and they have different composition and execution behavior.
| Format | How it starts | Best use | Execution notes |
|---|---|---|---|
| Cloud-config | #cloud-config as the first line, followed by YAML |
Declarative users, packages, files, and standard settings | Modules process the YAML in cloud-init’s configured stages; syntax and indentation must be valid. |
| Executable user-data script | A valid interpreter line such as #!/bin/bash |
Shell logic, conditionals, loops, or commands not represented by a cloud-config module | A user-data script is a single script executed once per instance, in the final stage. |
| MIME multipart | A multipart content type with separate parts | Combining cloud-config, scripts, and frequency-specific parts | Parts can be marked for per-boot or per-once behavior instead of treating everything as one script. |
Use cloud-config for predictable operating-system setup and reserve shell for logic that genuinely needs it. Do not paste YAML into a shell-script field or add a shell shebang to a cloud-config document; cloud-init uses the first line and content type to decide how to interpret user-data.
Create secure access before installing anything else
The first successful SSH login is the most important outcome of first boot. Keep the distribution’s default user when the image or provider depends on it, then add a named account for administration. Install an SSH public key and grant only the sudo rights the account needs.
Cloud-init warns that password hashes in intercepted cloud-config are a security risk. Prefer SSH key authentication and keep private keys out of user-data. User-data may be visible in provider consoles, APIs, logs, backups, or support systems.
If you define the users list, include default when you still need the image’s default account and any provider-injected key. Replacing the list without that entry can remove the account you expected to use.
Rank #2
- WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
- AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
- PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
- ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
- COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
Starter cloud-config
#cloud-config
users:
- default
- name: deploy
groups: [sudo]
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
shell: /bin/bash
lock_passwd: true
ssh_authorized_keys:
- ssh-ed25519 REPLACE_WITH_YOUR_PUBLIC_KEY
package_update: true
packages:
- nginx
write_files:
- path: /etc/motd.d/cloud-init
permissions: '0644'
content: |
Provisioned by cloud-init.
runcmd:
- [ systemctl, enable, --now, nginx ]
Replace the example key with the complete public key from the person or automation account that will connect. The example creates deploy, locks password authentication for that account, installs Nginx, writes a login message, and enables and starts the service.
Why each directive is placed where it is
usersestablishes the login account and its key before you need to connect.package_updaterefreshes package metadata;packagesthen requests installation through the distribution’s package manager.write_fileswrites known content with an explicit path and mode.runcmdrecords commands for execution late in boot, after earlier modules have prepared the machine.
Quote YAML-sensitive characters. Colons, brackets, hashes, and shell metacharacters can change how YAML is parsed. For commands containing shell syntax, use a correctly quoted string only when you intentionally want a shell; otherwise prefer list form, as in the Nginx command, so each argument is unambiguous.
Avoid writing temporary files under /tmp during cloud-init. Cloud-init documents a race with systemd-tmpfiles-clean; use /run for transient files that must survive only for the current boot.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Attach user-data while creating the VPS
User-data is normally supplied at provisioning time. Save the file in version control, review it as deployment code, and pass the exact file to the provider rather than relying on an unrecorded console paste.
DigitalOcean control panel
During Droplet creation, place the cloud-config or script in the control panel’s Startup scripts field. The field is part of the creation request. DigitalOcean states that user-data cannot be modified after a Droplet is created, so a mistake generally requires correcting the file and creating a replacement instance (or applying the fix manually through another access path).
DigitalOcean API
Send the content in the creation request’s user_data field. Keep the request body and the source file under the same change-control process so you can identify exactly which bootstrap version produced an instance.
DigitalOcean CLI
The doctl command supports an inline value or a file:
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsRank #3
- Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
- Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
- Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
- ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
- Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
doctl compute droplet create app-01
--region nyc3
--size s-1vcpu-1gb
--image ubuntu-24-04-x64
--ssh-keys YOUR_KEY_ID
--user-data-file ./cloud-config.yaml
You can use --user-data when the content is short enough to pass inline. The exact image slug, region, size, and key ID must match the resources in your account; the important part for cloud-init is that the creation request carries the user-data.
Provider differences to check
| Question | Why it matters | DigitalOcean documentation states |
|---|---|---|
| Is cloud-init present in the image? | Without the package and its datasource support, user-data is ignored. | Latest Ubuntu and CentOS images support it. |
| Where is user-data entered? | A wrong field or API property means no bootstrap is delivered. | Startup scripts field, API user_data, and doctl --user-data/--user-data-file. |
| Can it be changed later? | Immutable input requires a replacement plan for corrections. | It cannot be modified after a Droplet is created. |
| Where do you verify execution? | Log paths and console access determine how you recover from a failed first boot. | Check the provider console and /var/log/cloud-init-output.log; inspect /var/log/cloud-init.log for module errors. |
Understand when cloud-init runs
Cloud-init processes modules in stages. bootcmd is intended for very early boot operations. runcmd does not immediately execute each line while cloud-init parses the file; it writes a script that the scripts_user module runs in the final stage.
The practical order is:
- The image boots and cloud-init discovers the provider’s datasource and user-data.
- Early modules perform low-level setup; use
bootcmdonly when an operation must happen before normal configuration. - Configuration modules create users, install keys, update package metadata, install packages, and write files.
- The final stage runs user-data scripts and the script generated from
runcmd. - Cloud-init records output and module errors in its logs.
The runcmd module and ordinary user-data scripts run once per instance. MIME multipart lets you declare per-boot or per-once scripts when a recurring action is truly required. Do not put a task that must run every reboot into a one-time script and assume it will repeat.
Verify the first boot instead of assuming success
Wait for the instance to become reachable, then verify both access and the intended state. A green provider status does not prove that YAML parsed or that the final-stage commands completed.
Free tools Windows power users keep installed
One-click scans. No signup required.
- Use the provider console if SSH is unavailable and confirm that the instance reached a login prompt.
- Inspect the complete output log:
sudo less /var/log/cloud-init-output.logDigitalOcean documents grepping this file for
userdatawhen checking whether user-data was processed. - Inspect module-level diagnostics:
sudo less /var/log/cloud-init.logLook for YAML parsing errors, datasource failures, package-manager failures, and non-zero command exits.
- Test the named account and key from a separate terminal:
ssh -i ~/.ssh/your_private_key deploy@SERVER_ADDRESS - Confirm identity and sudo scope:
id deploy sudo -n true sudo -n systemctl status nginx - Check every requested artifact: installed packages, file contents and permissions, enabled services, hostname, locale, and application logs.
Test from outside the VPS as well. A service can be active locally while a provider firewall, host firewall, incorrect bind address, or unopened port prevents the connection you actually need.
Troubleshoot common cloud-init failures
No effect at all
First confirm that the selected image contains cloud-init and that it is enabled. Then confirm that user-data was attached to the creation request, not merely saved in a local file. On providers with multiple creation paths, compare the control-panel field, API property, and CLI option; a valid file sent through the wrong field is indistinguishable from no user-data.
Check /var/log/cloud-init-output.log and /var/log/cloud-init.log. If neither shows your content, the problem is usually image support, datasource delivery, or an incorrect provisioning interface rather than a command inside the script.
Rank #4
- Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
- Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
- 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
- Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
- USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
YAML parsing or indentation failure
YAML is whitespace-sensitive. Align child keys consistently, quote values containing colons or other YAML syntax characters, and ensure the first line is exactly #cloud-config with no preceding text. For commands with arguments that include shell metacharacters, use list form and quote each YAML value deliberately.
A parser error can prevent later modules from running, so fix the earliest syntax error shown in cloud-init.log before investigating package or service behavior.
SSH lockout after changing users
Use the provider console to inspect /home, the account’s ~/.ssh/authorized_keys, and permissions. Verify that the public key corresponds to the private key you are using and that the key is assigned to the intended user. If you still need the distribution account or its provider-injected key, add default to the users list instead of replacing it.
Check that the home directory and .ssh path are owned by the user and are not group- or world-writable. Keep a console or recovery path available before testing a change that disables password authentication or removes an account.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →runcmd appears to have been skipped
Remember that runcmd runs in the final stage. A command may be waiting behind package installation, or an earlier module may have failed. Search both cloud-init logs and the service’s own log. Confirm that the YAML entry is valid and that executable paths, environment variables, working directories, and permissions exist at final-stage time.
If a command depends on a service, express the dependency explicitly or use a service manager command that waits for the required state. Do not infer success merely because the VPS received an IP address.
Package installation fails
Read the package-manager output in cloud-init-output.log. Check DNS resolution, outbound network access, repository availability, disk space, and package locks. A package operation that failed because networking was unavailable should not be blindly rerun while another package manager process is active.
Best Value
- Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
- Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
- Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
- Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
- Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
After correcting the cause, rerun only an operation designed to be safe. Package installation should tolerate an already-installed package; destructive shell commands should have explicit guards.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →The provider behaves differently than expected
Compare the provider’s image list, user-data entry point, API and CLI syntax, console access, log locations, and mutability rules. A workflow that works on one provider can fail on another if its image omits cloud-init or its API encodes user-data differently. Treat those characteristics as part of the VPS selection decision, not as implementation details discovered after lockout.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Design scripts that are safe to debug and rerun
Cloud-init’s normal frequency is once per instance, but debugging often involves manually invoking commands or rebuilding an instance. Make every operation explicit about whether it is safe to repeat.
- Use package declarations or package-manager checks so installing an existing package is harmless.
- Create directories with
install -dand set ownership and mode after creation. - Write complete files atomically where practical instead of appending duplicate lines on every test.
- Guard destructive actions with a condition that proves the intended target is present.
- Use service-manager commands that are idempotent, such as enabling an already-enabled unit and starting an already-running service.
- Log meaningful progress so a failed final-stage command can be located without guessing.
- Keep secrets out of scripts and logs; use the provider’s secret mechanism or a post-bootstrap secret-delivery system.
Do not confuse a manual rerun with cloud-init’s normal lifecycle. Running a command from an SSH session does not change the fact that the original user-data was consumed once. For a clean test of a revised bootstrap, create a disposable instance from the same image and attach the revised file at creation time.
Use MIME multipart only when separate frequencies are needed
A single cloud-config file is easier to review. MIME multipart is useful when you need several content types or different schedules—for example, cloud-config for users and packages, a one-time script for application setup, and a per-boot script for a narrowly defined recurring action.
Each part must declare its content type and carry the content appropriate to that type. Keep the parts small, document their intended frequency, and test the assembled message on a disposable VPS. A per-boot action should be safe on every reboot; never put one-time initialization or irreversible data changes into it without a guard.
A repeatable provisioning checklist
- Select a cloud-init-enabled image and record its default-user behavior.
- Generate or choose the SSH key pair; keep the private key off the VPS and out of user-data.
- Write cloud-config for users, keys, packages, files, and services; use a script only for logic the modules cannot express.
- Validate indentation, quoting, command argument form, and file permissions.
- Store the file in version control with a clear change history.
- Attach it through the provider’s documented creation field, API property, or CLI option.
- Create a disposable test instance before using the same bootstrap on production data.
- Check cloud-init output and module logs, then test SSH, sudo, packages, files, and services.
- Record the exact image, user-data revision, provider interface, and verification results.
- For changes, make a safe, idempotent revision and plan either a replacement instance or a controlled post-boot update when user-data is immutable.
The success criterion is operational, not cosmetic: you can log in with the intended key, the named non-root account has the expected sudo scope, requested packages and files exist with correct permissions, services are enabled and healthy, and the cloud-init logs show no unaddressed errors. Once those checks pass, cloud-init has done its job as a first-boot foundation for the rest of your Linux VPS administration.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




