Slackware in AWS on EC2

Published: 9/24/2026

The problem

I wanted to run a stable non-systemd Linux distribution that I actually know a lot about AND create a custom AMI for work that we can spin up any time that has a number of our tools (such as .NET and nginx) pre-installed.

Slackware is the distribution I know best. It's far more stable than the Ubuntu server we use for our PHP hosting right now. And it doesn't use systemd. At least for now.

The Process

I started of reviewing this how-to on Slackware Docs but it lacked a lot of detail. Andrew Sarangan's tutorial was better and got me 90% of the way there. I wanted stable with few regular updates so I skipped the upgrade to Slackware-current. Slackware-current is generally believed to still be highly stable (more stable than many "production" distros) but current gets a LOT of updates regularly, including kernel upgrades.

I followed Andrew's tutorial pretty closely, including using VMware Workstation Pro. I didn't find any issues with lag so I didn't make the vmx customizations that he describes. I also stuck with ELILO instead of switching to GRUB. Your mileage may vary.

  1. Create Slackware virtual machine
    • Create virtual machine with at least 32 GB (I started with 32 GB but later resized to 50 because of Slackware's size requirements, so just start with at least 50)
    • I intended to use the newer EC2 generations (generally less expensive and more powerful), which require EFI, so I updated the virtual machine firmware type to UEFI before installing Slackware (Options > Advanced)
    • Install from Slackware64-15.0 ISO.
      • Here I deviated from Andrew's instructions a bit because building nginx on my home Slackware server became a pain because I missed some dependencies. So just include the X series. I ended up installing everything except the E, F, KDE, XAP, and XFCE series. I left Y because I like laughing at the jokes fortune prints on login.
  2. Change partition names to the UUIDs
    • Follow this exactly as explained, editing /etc/fstab and /boot/efi/EFI/Slackware/elilo.conf
    • Reboot to ensure everything works correctly
    • One addition to this: once you reboot, you will want to copy the /boot/efi/EFI/Slackware directory to /boot/efi/EFI/BOOT or you may get "No bootable device found." from EC2 on boot:
      
      mkdir -p /boot/efi/EFI/BOOT
      cp /boot/efi/EFI/Slackware/* /boot/efi/EFI/BOOT/
      mv /boot/efi/EFI/BOOT/elilo.efi /boot/efi/EFI/BOOT/BOOTX64.EFI
      ls -l /boot/efi/EFI/BOOT/ 
                                  
    • Reboot again to ensure nothing broke
  3. Configure SSH and verify connectivity
    • Create a new user (Slackware makes this really easy with the adduser script)
    • Add your public key, disable password authentication
  4. Configure
    • Make any configuration changes, install software (such as docker, sbopkg), etc. that you want to persist
  5. Export OVF
    • EC2 requires a special format so use the "Export to OVF" in VMware and choose a location on disk that you can find easily
  6. Upload the exported VMDK file to a new bucket on S3
  7. Convert the VMDK to an EC2 snapshot
    • Andrew had a bash script but as I'm more comfortable with PowerShell (and don't really have bash configured on my workstation), I opted to port it to PowerShell with a few tweaks so you could skip deleting and creating the vmimport role if you're re-running this on the same account (such as when updating the AMI).
    • Make sure the AWS CLI is installed and configured
    • The calling user (the IAM user you generate credentials for) needs the following permissions (update with your bucket name and account ID):
      
      {
        "Version": "2012-10-17",
        "Statement": [
          {
            "Sid": "ManageTheVmimportRole",
            "Effect": "Allow",
            "Action": [
              "iam:CreateRole",
              "iam:DeleteRole",
              "iam:PutRolePolicy",
              "iam:DeleteRolePolicy",
              "iam:GetRole"
            ],
            "Resource": "arn:aws:iam::111122223333:role/vmimport"
          },
          {
            "Sid": "PassTheRoleToVmImportExport",
            "Effect": "Allow",
            "Action": "iam:PassRole",
            "Resource": "arn:aws:iam::111122223333:role/vmimport"
          },
          {
            "Sid": "RunAndWatchTheImport",
            "Effect": "Allow",
            "Action": [
              "ec2:ImportSnapshot",
              "ec2:DescribeImportSnapshotTasks",
              "ec2:CancelImportTask",
              "ec2:DescribeSnapshots"
            ],
            "Resource": "*"
          },
          {
            "Sid": "StageTheVmdkInS3",
            "Effect": "Allow",
            "Action": [
              "s3:GetBucketLocation",
              "s3:ListBucket",
              "s3:GetObject",
              "s3:PutObject"
            ],
            "Resource": [
              "arn:aws:s3:::amzn-s3-demo-import-bucket",
              "arn:aws:s3:::amzn-s3-demo-import-bucket/*"
            ]
          }
        ]
      }
                                      
  8. Create Amazon Machine Image (AMI) from the snapshot
    • Find the new snapshot in your chosen region and select it.
    • Under Actions, choose Create Image From Snapshot
      • Be sure you select UEFI as the boot mode. Everything else can be left as-is (aside from the name, of course)
  9. Launch instance
  10. Kernel updates
    • You will want to generally avoid kernel updates but there may be security updates that you don't want to skip. Create this script as /root/kernel-install.sh to make it easier on yourself (I added this to the local VM so it's persisted on each new instance automatically):
      
      #!/bin/bash
      geninitrd
      cp /boot/vmlinuz-generic /boot/efi/EFI/Slackware/vmlinuz
      cp /boot/vmlinuz-generic /boot/efi/EFI/BOOT/vmlinuz
      cp /boot/initrd.gz /boot/efi/EFI/Slackware/initrd.gz
      cp /boot/initrd.gz /boot/efi/EFI/BOOT/initrd.gz
                                  

Additional Notes

Some other commands it will be helpful to know:

  • Increasing size of EBS volume (get correct partition numbers, etc. from parted /dev/nvme0n1 print):
    
    # parted /dev/nvme0n1 resizepart 3 100%
    # resize2fs /dev/nvme0n1p3
                                

Slackpkg blacklist:

                    
kernel-generic.*
kernel-huge.*
kernel-modules.*
kernel-source
# conflicts with SBo version of GO, necessary for docker install
gcc-go-*
# This one will blacklist all SBo packages:
[0-9]+_SBo
1alien
[0-9]+_wsr
e/
f/
kde/
k/
xap/
xfce/
                    
                

About the Author

Adam is the lead developer at Manwaring Web Solutions. Programming since the age of 10, he taught himself HTML and basic CSS.