Getting Started with Oracle Linux
Oracle Cloud Infrastructure has a set of Oracle Linux platform images that you can select when creating an instance.
For more information about Oracle Linux platform images, see Platform Images. For information about specific releases of platform images, see Release Information.
Key features for Oracle Linux on Oracle Cloud Infrastructure
Oracle Linux images available on Oracle Cloud Infrastructure include:
The advantages of Oracle Cloud Infrastructure Oracle Linux images over traditional Oracle Linux deployments are:
-
Instances automatically have access to Unbreakable Linux Network (ULN) content.
-
If the instance is connected to a service gateway, it has access to ULN content through the regional yum servers. Unlike the publicly available Oracle Linux yum server, the Oracle Cloud Infrastructure regional yum servers mirror all ULN channels. Thus, you can access ULN content without registering the system with ULN or using alternate tools to manage channel access, which simplifies software management on the instance.
-
-
All images have Oracle Ksplice installed by default.
-
You can run Ksplice to install patches manually or enable automatic updates to get the latest security patches without any need to reboot.
-
-
The default kernel is the latest version Unbreakable Enterprise Kernel (UEK) available for the image.
-
Setting the default kernel to UEK ensures the broadest functionality support immediately after deploying an instance.
-
-
Instances can use the OCI Utilities.
-
The OCI utilities are a set of custom tools that allow the instance to access information about infrastructure resources. These tools can help automatically discover or provision resources as you need them.
-
Creating an Instance
Create a Oracle Linux instance using Oracle-provided images or Marketplace images.
If this is your first time creating an instance, before you start we recommend creating a Virtual Cloud Network (VCN) first. From the console dashboard, under Build select Set up a network with a wizard, and then select Create VCN. The "Create a Virtual Cloud Network" workflow creates a VCN which automatically configures both a public and a private subnet along with any required gateways and route rules. In addition, the workflow provides an option to configure IPv6.
For more information, see:
To create an Oracle Linux instance, complete the tasks in following sections.
Oracle Cloud Infrastructure has introduced a New Console Experience. Switch to the console's preview mode to follow the new Create Instance multiple-step workflow.
Basic information
Navigate to the compute instances page and start the Create Instance workflow.
- Open the navigation menu and select Compute. Under Compute, select Instances.
- Click Create instance.
- Enter the Name and select the compartment from Create in compartment.
You can add or change the name later. The name does not need to be unique, because an Oracle Cloud Identifier (OCID) uniquely identifies the instance.
- In the Placement section:
- Select the Availability domain.
- (Optional) Select a capacity type, turn on cluster placement group, or specify a fault domain, click Show advanced options. For more information, see Define instance details.
- In the Image and shape section:
- Under Image, select an Oracle Linux image for the instance. By default, an Oracle Linux image is used to boot the instance. To select a different Oracle Linux image or a boot volume, click Change image. For more information, see Selecting an image, Oracle-provided images, and Marketplace images.
- Under Shape, select a shape for the instance. By default, the shape is an AMD virtual machine. To select a different shape or change the configuration of the default shape, click Change shape. For more information, see Selecting a shape.
- (Optional) Click Show advanced options to configure the following for the instance:
- Management - instance metadata service, initialization script, tagging, and security attributes.
- Availability - live migration options.
- Oracle Cloud Agent - plugins to run on the instance. By default, Custom Logs Monitoring, Compute Instance Run Command, Compute Instance Monitoring, and Cloud Guard Workload Protection are selected.
For more information, see configuring advanced options and live migration.
- Click Next.
Security
Enable either shielded instances or confidential computing but not both, simultaneously.
- (Optional) Enable Shielded instance.
- (Optional) Enable Confidential computing.
- Click Next.
Networking
Configure a virtual network interface card (VNIC) using a virtual cloud network (VCN). You have the option of creating a new VCN or using an existing one; however, to have the full range of options, we recommend that you create a VCN before creating an instance.
If you are unsure of your networking needs, review:
- Networking Scenarios
- Configure Primary VNIC
- Configure Primary IP Address
- Configure Advanced Network Settings
To configure a VNIC and optionally add SSH keys, complete the following steps:
- Enter a VNIC name.
- For the Primary network select one of the following options:
- Select existing virtual cloud network
Use this option if you already have a VCN. Select the VCN compartment and the VCN name from the lists.
- Create new virtual cloud network
Use this option if you do not have an existing VCN or do not want to use an existing one. Enter a name for the new VCN and select a compartment for it.
- Select existing virtual cloud network
- For the Subnet select one of the following options:
- Select existing subnet
Use this option if you already have a subnet. Select the subnet compartment and subnet name from the lists.
- Create new public subnet
Use this option if you created a new VCN in the previous step or if you want a new subnet for an existing VCN. Enter a name for the new subnet, select a compartment for it, and enter a CIDR block.
- Select existing subnet
- In the Primary VNIC IP addresses section:
- If you created a new public subnet in the previous step, the private and public IPv4 addresses are automatically assigned.
- If you are using an existing subnet:
- For Private IPv4 address, select Automatically assign or Manually assign. For the manually assign option, enter an IP address.
- For Public IPv4 address, leave the default option which assigns a public IP address. Or, clear the default option if you do not need a public IP address. If you are unsure, you can always assign one later, if needed.
- For IPv6 addresses, you must enable IPv6 addressing on the VCN and subnet before you can assign IPv6 addresses to the instance.
- (Optional) Expand Advanced Options and configure any of the following:
- Use network security groups to control traffic: Select this option to add the instance's primary VNIC to one or more network security groups (NSGs).
- DNS record: Select whether to assign the VNIC a private DNS record. See DNS in Your Virtual Cloud Network.
- Launch options: Select the networking launch type.
- In the Add SSH Keys section, select one of the following options:
- Generate a key pair for me - click Download private key and Download public key to save the key pair locally.
- Upload public key file (.pub) - select or drop your public key in the SSH public key field.
- Paste public key - copy an existing public key and paste it in the SSH public key field.
- No SSH keys - If you don't provide SSH keys, you will not be able to connect to the instance using SSH.
For more information, see Add SSH Keys or Managing Key Pairs on Linux Instances.
- Click Next.
Storage
Configure boot and block volumes.
- (Optional) In the Boot Volume section, configure the size and encryption options for the instance's boot volume:
- Enable Specify a custom boot volume size and keep the default values which provides balanced performance or change them for your performance needs.
- By default, Use in-transit encryption is enabled. Disable if you do not want to encrypt data.
- Enable Encrypt this volume with a key that you manage to use an existing key.
- (Optional) In the Block Volume section, click Attach block volume to open the panel.
- For Volume, select a volume from a compartment, create a new volume, or enter a volume OCID.
- Determine the Attachment type. By default, the recommended attachment type is ISCSI. Optionally, select a device path for the block volume.
- Select an Access type option of Read/write, Read/write, shareable, or Read only, shareable.
- Click Attach.
For more information, see Attach Block Volumes.
- Click Next.
Review
Review the instance configuration and do one of the following:
- If you are satisfied with the configuration, click Create. The instance's detail page is created and its status displays Provisioning. To track the progress of the operation and troubleshoot errors that occur during instance creation, use the associated work request.
- To return to any section and make changes, click Previous.
- To stop the create instance workflow, click Cancel.
- To create a stack that you can use to install, configure, and manage your compute instance through the "infrastructure-as-code" model, click Save as stack. For more information, see Creating a Stack from a Resource Creation Page.
Accessing an Instance
Connect to your Oracle Cloud Infrastructure instance using SSH.
Prerequisites
Before connecting, obtain the following:
- SSH client
- Public IP address of the instance
- Path to the SSH-2 RSA private key file
Connecting Using SSH
- Complete the Prerequisites.
- From an SSH client, use the default
opc
user to connect to the instance.For example:
ssh -i PRIVATE_KEY_PATH opc@PUBLIC_IP_ADDRESS
- After you’re logged in as
opc
, you can use thesudo
command to run administrative tasks.For example, run the following command to show details for all storage devices attached to your instance:
sudo oci-iscsi-config --show
For more information, see:
Installing Software
Install software by enabling repositories from the Oracle Cloud Infrastructure regional yum servers.
Unlike the publicly available Oracle Linux yum server, the Oracle Cloud Infrastructure regional yum servers mirror all ULN channels. Therefore, compute instances can access ULN content without having to register the system with ULN. For more information, see:
Connecting to the Regional Yum Server
Instances connected to the service gateway automatically have access to the regional
yum servers. The $ociregion
and $ocidomain
yum variables
determine which regional server the instance connects to.
For example, the baseurl
to the _latest
repository for Oracle Linux 8 is:
baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL8/baseos/latest/$basearch/
-
Set the
$ociregion
variable by populating content in/etc/yum/vars/ociregion
.If the
ociregion
file does not exist or is empty, thebaseurl
points to the publicly accessible Oracle Linux yum server. Typically, when you create the instance the$ociregion
variable is set to point to the closest regional yum server on the Oracle Cloud Infrastructure service network. For example, if$ociregion
is set to-phx
, thebaseurl
expands to point to the regional yum server in Phoenix. - Set the
$ocidomain
variable by populating content in/etc/yum/vars/ocidomain
.
Accessing ULN Content
To access ULN content on the regional yum servers, install the appropriate release-el
packages and enable the repositories that you require access to.x
For example, on Oracle Linux 8, you can run the following commands to access the ol8_oci_included
repository, where tools like Oracle InstantClient, the Oracle Java Development Kit and Oracle Java Runtime Environment are located:
sudo dnf install oci-included-release-el8 sudo dnf config-manager --enable ol8_oci_included
Other ULN channels are also available directly through the Oracle Cloud Infrastructure regional yum servers. For example, to access the Ksplice channels on an Oracle Linux 8 compute instance, you can do:
sudo yum install ksplice-release-el8 sudo yum-config-manager --enablerepo ol8_ksplice ol8_x86_64_userspace_ksplice
Most of these channels are installed and available by default in the latest platform images.
Using OS Management Hub
You can use OS Management Hub to manage packages on Oracle Linux instances, including installing, removing, and updating packages. See Oracle Linux Package Management for more information.
OS Management Hub uses software sources to provide packages to instances, and to track the available updates to those packages. A software source is a collection of packages. Software sources enable you to control which packages can be installed on instances without having to manually log in and configure the repositories on each instance. See Managing Software Sources for more information.
Updating an Instance
Use Oracle Ksplice, OS Management Hub, or Oracle Autonomous Linux to help automate system updates, but also follow recommended guidance to keep your system up to date.
Using Oracle Ksplice
You can use Oracle Ksplice to patch a system without requiring a reboot. However, these updates only occur in-memory. You must also update packages on-disk to their latest versions, so that when the system reboots, it starts from the most current release. Follow the recommendations in Maintaining the System.
Using OS Management Hub
You can use OS Management Hub to manage and monitor updates for the OS environments Oracle Linux instances. OS Management Hub allows you to group instances for updates, providing automated patch and fleet management capabilities. See Oracle Linux Package Management for more information.
Using Autonomous Linux
Autonomous Linux can automatically handle system package updates on a regular schedule. Autonomous Linux provides automatic daily updates in addition to the zero-downtime Ksplice updates for kernel, OpenSSL, and glibc libraries. These updates are referred to as autonomous updates. When you create an Autonomous Linux instance, the service automatically creates a controlled scheduled job for autonomous updates. You can update the start time for the daily autonomous updates using the Console, CLI, or API.
Maintaining the System
Regularly update the operating system and user space packages to obtain the latest bug fixes and security patches.
Oracle recommends that you:
-
Subscribe the instance to the
_latest
yum repository for your Oracle Linux release. -
Update any software that was installed outside of the Oracle Linux yum package manager.
For example, tools such as
flatpak
andsnap
, for installing desktop applications; andpip
,gem
andnpm
, for installing Python, Ruby and Node libraries and modules, all have their own software update mechanisms. -
Always update instances to the most recent release of the operating system.
Oracle Linux uses a rolling update level approach for keeping software up to date. For example, Oracle Linux 8.4 or Oracle Linux 8 Update 4, are rolling snapshots of the latest supported packages for the Oracle Linux release and are not considered independent versions of Oracle Linux.
-
Manually update packages or install and configure the appropriate tool for automatic updates.
- For Oracle Linux 7 instances you can use the
yum-cron
utility described in Oracle Linux 7: Managing Software. - For Oracle Linux 8 and 9 instances you can use the
dnf-automatic
utility described in Oracle Linux 8: Managing Software on Oracle Linux and Oracle Linux 9: Managing Software in Oracle Linux.
- For Oracle Linux 7 instances you can use the
Adding Users and Groups
Use the default opc
user to add users and groups to a newly created instance.
Oracle recommends that you create and configure users and groups according to your access requirements. Access the instance as the opc
user (see Accessing an Instance), and then add users and groups as necessary. See Create users and groups on Oracle Linux for a general introduction to users and groups on Oracle Linux.
What is the opc user?
Oracle Linux instances have a default opc
user. Use this account to create and configure additional users and groups.
The opc
account has:
- Full
sudo
privileges. -
No password configured.
Instead you access the account over SSH with a key pair configured when you create the instance (see Accessing an Instance).
Adding a User
To add a user named alice
to the system:
sudo useradd alice
To set a password for the user:
sudo passwd alice
Adding a Group
To add a group called staff
to the system:
sudo groupadd staff
To add the user alice
to the group staff
:
sudo usermod -G staff alice
Manage the users in a group using the groupmems
command. For example, to remove alice
from the group staff
:
sudo groupmems -d alice -g staff
Configuring Permissions
Define permissions by configuring users and groups within /etc/sudoers
.
By default, members of the wheel
group can use sudo to obtain all root privileges. You can add entries for users or groups by adding files to /etc/sudoers.d
. For example, the privileges assigned to the opc
user are defined in /etc/sudoers.d/90-cloud-init-users
.
Migrating to Oracle Cloud Infrastructure
You can migrate on-premises Oracle Linux images to Oracle Cloud Infrastructure with the oci-image-migrate
utilities. See OCI Image Migrate Utilities.
Oracle Linux Learning Resources
Use these resources to learn more about Oracle Linux.
- General Oracle Linux Documentation
- The general Oracle Linux documentation is not specific to Oracle Cloud Infrastructure but most of the content still applies.
- Training Resources
-
Use the following Oracle Linux training resources to grow your skill set using free videos and hands-on tutorials and labs.
- Blogs and Community Forums
- Use these resources to track features highlighted by Oracle or to reach other community users for more help and information.