A police officer was injured as a result of trouble at the demonstration in support of dissident republicans refusing meals.
They were protesting over prisoner Dr Issam Bassalat being held in a COVID-19 isolation area.
It has been prison policy since March that anyone entering the jail is isolated for 14 days as a precaution.
The protest was organise by Saoradh, the political wing of the New IRA.
The four men appeared at Lisburn Magistrates’ Court via videolink from police custody.
Jude McCrory, 23, from Magowan Park in Derry, was charged with disorderly behaviour.
The other three men – Emmet McSheffrey, 21, from Oakland Park, Derry; Caoimhin Murphy, 20, from Altowen Park, Coalisland; and Jordan Devine, 20, from Synge Court, Derry – were charged with rioting.
McSheffrey, Murphy and Devine were also charged with having fireworks without a licence.
The court heard that the charges arose following an overnight protest involving “over 100 people” at the prison visitors centre.
A PSNI detective sergeant said there had been a “confrontation with police” and that there had been “fireworks thrown over the perimeter fence”.
Devine, the court heard, is alleged to have “thrown at least five missiles” at police.
The court also heard that McCrory’s charge of disorderly behaviour arose when the others were being arrested so “is separate from the activity of the protestors”.
The police did not object to the defendants being freed on bail and the officer said that the police do not have “evidence that they organised it [the protest] but certainly they’re influential”.
The detective asked for bail conditions to include a curfew and a ban on being in a private vehicle but the judge refused after hearing defence submissions.
Defence lawyers argued that with Dr. Bassalat’s quarantine ending tomorrow “there will be no further protests”.
All four were freed on their own bail of £500 with conditions, including that they are “not to be within 100 metres of a notified or unnotified protest”.
Their cases were adjourned until Monday, October 26.